How can I programmatically detect whether a webcam device is plugged in to the PC or not, return 'True' or 'False.
A:
Might be some better way of doing this but the only one I can think of would be to use GetRawInputDeviceList
to enumerate all USB devices and then using GetRawInputDeviceInfo
to get out more information about them.
Webcams should show up as HID, but I don't know if there's any way to tell for sure if it's a webcam.
See here for a C# sample (could probably use a C# to VB.Net converter if you're not comfortable with C#).
ho1
2010-06-01 07:40:17