Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dim DevType As Integer = Runtime.InteropServices.Marshal.ReadInt32(M.LParam, 4)
- If DevType = DBT_DEVTYP_VOLUME Then
- Dim Vol As New DEV_BROADCAST_VOLUME
- Vol = Runtime.InteropServices.Marshal.PtrToStructure(M.LParam, GetType(DEV_BROADCAST_VOLUME))
- If Vol.Dbcv_Flags = 0 Then
- For i As Integer = 0 To 20
- If Math.Pow(2, i) = Vol.Dbcv_Unitmask Then
- Dim usb = From getInfo In System.IO.DriveInfo.GetDrives
- Dim d As IO.DriveInfo
- For Each d In usb
- If d.IsReady = True AndAlso d.DriveType = IO.DriveType.Removable Then
- unidades.Items.Add(d.Name & d.VolumeLabel).ToString()
- End If
- Next
- Exit For
- End If
- Next
- End If
- End If
- Dim DevType As Integer = Runtime.InteropServices.Marshal.ReadInt32(M.LParam, 4)
- If DevType = DBT_DEVTYP_VOLUME Then
- Dim Vol As New DEV_BROADCAST_VOLUME
- Vol = Runtime.InteropServices.Marshal.PtrToStructure(M.LParam, GetType(DEV_BROADCAST_VOLUME))
- If Vol.Dbcv_Flags = 0 Then
- For i As Integer = 0 To 20
- If Math.Pow(2, i) = Vol.Dbcv_Unitmask Then
- Dim usb = From getInfo In System.IO.DriveInfo.GetDrives
- Dim d As IO.DriveInfo
- For Each d In usb
- If d.IsReady = False AndAlso d.DriveType = IO.DriveType.Removable Then
- unidades.Items.Remove(d.Name & d.VolumeLabel & usb.ToString)
- End If
- Next
- Exit For
- End If
- Next
- End If
- End If
- End Select
- End If
- MyBase.WndProc(M)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement