USB Detection - repost

sdlangers

Centurion
Joined
Dec 3, 2002
Messages
118
Hi,

Does anyone know how to detect if a USB card is plugged in. Is there some event you can use?

i.e. have a program written in .net that detects (and does something) when a usb device is inserted?

Thanks.
 
something that detects hardware when inserted is best left to Microsoft. Your talking very low level programing there... lots of Win32Api calls if not and more than likely even lower (straight C++ or Assebmly).
 
im sure theres a way to do it.. all the various software (not just microsoft) for usb devices do it.. e.g. camera software - once you plug in the camera to the usb - it launches the software to download the pictures.. it's this type of event that i need..

i've no problem with api calls.. or low level programming.. this is why i'm asking.. anyone know how to do it?

thanks.
 
Hi,


Thanks! that looks like its the start. Your code fires when i insert a USB device. Next step is to detect what type of device is inserted. At least i have this for a start.

If anyone knows how to get the device signature, i would appreciate it.

Thanks again
 
Handling the WM_DEVICEMESSAGE message I can now detect if any device is (dis)connected. But I only want to focus on USB events. I can't find any good info on this on Google.

Maybe anyone here has a clue?
 
Same problem

Hai,
Base on the sample given by Derek Stone, device changed can be detected, but how can i futher to get the device name ? and when my program start , how can i get the pluged-in USB device as the one at sytem tray program


Thank you
 
Back
Top