sdlangers Posted October 27, 2003 Posted October 27, 2003 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. Quote
bri189a Posted October 29, 2003 Posted October 29, 2003 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). Quote
sdlangers Posted October 29, 2003 Author Posted October 29, 2003 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. Quote
*Gurus* Derek Stone Posted October 30, 2003 *Gurus* Posted October 30, 2003 The example "Device Change", attached, should be a decent start.devicechange.zip Quote Posting Guidelines
sdlangers Posted October 30, 2003 Author Posted October 30, 2003 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 Quote
JackSparrow Posted November 19, 2003 Posted November 19, 2003 Is there perhaps a Visual C++ example around? I don't have/know Visual Basic. Thanks. Quote
JackSparrow Posted November 19, 2003 Posted November 19, 2003 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? Quote
kenchen Posted November 26, 2003 Posted November 26, 2003 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 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.