home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / vb6_sr_3 / module1.bas < prev   
Encoding:
BASIC Source File  |  1999-01-21  |  528 b   |  25 lines

  1. Attribute VB_Name = "Module1"
  2. Option Explicit
  3.  
  4. Declare Function GetShortPathName Lib "kernel32" Alias _
  5. "GetShortPathNameA" (ByVal lpszLongPath As String, _
  6. ByVal lpszShortPath As String, ByVal cchBuffer As Long) As Long
  7.  
  8. Public Function GetDosPath(LongPath As String) As String
  9.  
  10. Dim s As String
  11. Dim i As Long
  12. Dim PathLength As Long
  13.  
  14.         i = Len(LongPath) + 1
  15.  
  16.         s = String(i, 0)
  17.  
  18.         PathLength = GetShortPathName(LongPath, s, i)
  19.  
  20.         GetDosPath = Left$(s, PathLength)
  21.  
  22. End Function
  23.  
  24.  
  25.