I have been using FindFirst for awhile and found FindFirstVolume in MSDN which is here:
but I don't understand the output.
Erik.
Code: (Select All)
Const MAX_PATH = 260
Const INVALID_HANDLE_VALUE = -1
Declare Dynamic Library "kernel32"
Function FindFirstVolumeW~%& (ByVal lpFileName~%&, MAX_PATH)
Function FindNextVolumeW& (ByVal hFindFile~%&, Byval hFindPoint~%&, MAX_PATH)
Function FindVolumeClose& (ByVal hFindFile~%&)
End Declare
Dim ASCIIZ As String * 260
Dim Wfile.Handle As _Unsigned _Offset
' find first long filename
Wfile.Handle = FindFirstVolumeW(_Offset(ASCIIZ), MAX_PATH)
' check findirst error
If Wfile.Handle <> INVALID_HANDLE_VALUE Then
' filename/directory loop
Do
X$ = ASCIIZ
Do
X = InStr(X$, Chr$(0))
If X Then
X$ = Left$(X$, X - 1) + Mid$(X$, X + 1)
Else
Exit Do
End If
Loop
Print X$
Loop While FindNextVolumeW(Wfile.Handle, _Offset(ASCIIZ), MAX_PATH)
X = FindVolumeClose(Wfile.Handle)
End If
End
Erik.