04-01-2010 09:16 AM
Hello,
I have an application where I am setting a serial number in a USB device. I then remove the device from the Registry using Devcon (Devcon will not uninstall the device if it isn't plugged in). At this point I want the operator to unplug the device from the cable. My problem is that with the device uninstalled Devcon doesn't report the unplug event.
However, Device Manager will refresh upon unplugging the device, even with it uninstalled. So something tells it to refresh. How do I tap into that?
And I did look at this link, but couldn't get it to help me. Did I miss something there?
http://forums.ni.com/ni/board/message?board.id=170&message.id=249567&requireLogin=False
Tay
Solved! Go to Solution.
04-01-2010 09:36 AM - edited 04-01-2010 09:36 AM
One of the annoying bits about URLs is that they're static, so if the target no longer exists, or has been moved, the links are no longer valid. I know the two links that I had provided in my response in that other thread are no longer valid. The first one pointed to a LAVA thread that no longer exists. LAVA had a major server failure a while back. The other link points to a project that was moved to a new location. Don't know about George's site.
As for what to do now, one thing that you can do is to use the Windows Message Queue Library. The example that ships with the library is pretty self-explanatory. In your case you would want to listen to the WM_DEVICECHANGE message. The readme contained within the archive lists the values for the various messages.
04-01-2010 10:53 AM
Outstanding! That works great! I could even decipher Microsoft's instructions this time!
Thanks!!