Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Volume display utility
#1
I have been using FindFirst for awhile and found FindFirstVolume in MSDN which is here:

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
but I don't understand the output.

Erik.


Attached Files
.bas   findvol.bas (Size: 913 bytes / Downloads: 25)
Reply




Users browsing this thread: 2 Guest(s)