Declare Function GetProcAddress32W Lib "kernel" (ByVal hModule As Long, ByVal lpProcName As String) As Long
Declare Function LoadLibraryEx32W Lib "kernel" (ByVal lpLibFileName As String, ByVal hFile As Long, ByVal dwFlags As Long) As Long
Declare Function FreeLibrary32W Lib "kernel" (ByVal hInst As Long) As Long
Declare Function CallProc32W Lib "kernel" (ByVal LongFile As String, ByVal ShortFile As String, ByVal Buffer As Long, ByVal Funktion As Long, ByVal adr As Long, ByVal Params As Long) As Long
Function ShortFileName$ (ByVal a$)
hInst& = LoadLibraryEx32W("Kernel32.dll", 0&, 0&)
Dim ShortFile As String * 256
lpShort& = GetProcAddress32W(hInst&, "GetShortPathNameA")
l& = CallProc32W(a$, ShortFile, 256&, lpShort&, 6&, 3&)
ShortFileName$ = Left$(ShortFile, l&)
l& = FreeLibrary32W(hInst&)
End Function
|