I am developing a C# .NET 2.0 application wherein I need to scan for an attached HID. How can this be done? Because it is a HID, Windows does not assign a COM port to it. I only need to programmatically determine if the device is attached. Thank you.
ADDITIONAL INFORMATION
When I connect the USB device to my computer two entries appear under Human Interface Devices in the Device Manager. Clicking into their Properties yields this information in their respective Details tabs:
HID-compliant device Device Instance Id: HID\VID_1795&PID_6004\7&2694D932&0&0000
USB Human Interface Device Device Instance Id: USB\VID_1795&PID_6004\B973000000EB0D00
Here is an example of enumerating Hid devices on Windows:
Full class here: https://github.com/MelbourneDeveloper/Device.Net/blob/master/src/Hid.Net/Windows/WindowsHidDeviceFactory.cs
API Calls here: https://github.com/MelbourneDeveloper/Device.Net/blob/master/src/Hid.Net/Windows/HidAPICalls.cs
Here is a similar thing for Windows 10 (UWP):
Code:https://github.com/MelbourneDeveloper/Device.Net/blob/77439b1ab0f4b3ad97376e4e62c7efac0a749783/src/Device.Net.UWP/UWPDeviceFactoryBase.cs#L47
Android (https://github.com/MelbourneDeveloper/Device.Net/blob/77439b1ab0f4b3ad97376e4e62c7efac0a749783/src/Usb.Net.Android/AndroidUsbDeviceFactory.cs#L31):
Using Hid.Net, you can enumerate devices in the same way on any platform like below. See the full article.
In the WMI Code Creator select these options:
Namespace: root\WMI
Class: MSWmi_PnPInstanceNames
Select
InstanceNames
from the Results box for the following code: