• Welcome to Forum.Deepsoftware.Com. Please login or sign up.
 

Detecting USB HID insertion and removal

Started by nnsimon, July 15, 2009, 11:15:57 am

Previous topic - Next topic

nnsimon

Hey All

I am a newib to nrCommLib.  I have been looking at the examples and i am a bit lost.  What i want to do is

1. Detect the insertion of a usb HID device
2. Check the name/serial number of the device that was inserted
3. Detect the removal of the device

It is important that the sequence occur in the above order.  I have been able to detect the device but only if it is already inserted. The device may not be removed or inserted at any time.

Which component(s) do i use? How would i use it/them?

Thanks in advance for any help

Roman Novgorodov

July 16, 2009, 04:15:54 am #1 Last Edit: July 17, 2009, 07:40:35 am by Roman Novgorodov
Hello

Please take a look HID Demo:

{nrCommLib}\Demos\HidDemo\hiddemo.dpr

It detects WM_DEVICECHANGE and updates device list.
You can compare the device list before and after receiving this message.

Roman Novgorodov
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.

nnsimon