0
votes

I have a question about how to detect, on application startup, using C++ Win32 calls, if there is a device already inserted into a USB slot. I am not looking for mounted USB drives, since I can get that information by just looking for all mounted drive letters. I need to figure out if a device that doesn't get mounted as a drive already exists in the USB port.

I have looked through the Win32 API pages, and didn't see anything that seemed to answer this need. Looking online, I don't see anyone asking this question, so I am not really sure what my next steps should be.

Does anyone have a suggestion as to where I should start looking?

1

1 Answers

0
votes

You will need to use the WDK. Microsoft provides pretty comprehensive sample called 'DevCon', which basically provides all the functionality of the Device Manager, except on the command line:

https://code.msdn.microsoft.com/windowshardware/DevCon-Sample-4e95d71c