[API]
GetLogicalDrives

[INCLUDE]
IsRemoveableDrive
RemovableDevices_Register
RemovableDevices_Unregister

[CODE]
Public Sub RemovableDevices_RegisterAll(ByVal hWnd As Long)
  Dim xLong1 As Long
  Dim xLong2 As Long
  
#If Unicode Then
  If IsUnicode Then
#End If
    xLong1 = GetLogicalDrives()
    For xLong2 = 2& To 25&
      If (xLong1 And (2& ^ xLong2)) Then
        Select Case GetDriveTypeA(Chr(65& + xLong2) & ":")
          Case 2&, 5&
            Call RemovableDevices_Register(hWnd, xLong2)
          Case 3&
            If IsRemoveableDrive(xLong2) Then
              Call RemovableDevices_Register(hWnd, xLong2)
              End If
          End Select
        End If
      Next
#If Unicode Then
    End If
#End If
  End Sub
