Author Topic: Detecting USB HID insertion and removal  (Read 1965 times)

nnsimon

  • Newbie
  • *
  • Posts: 2
    • View Profile
Detecting USB HID insertion and removal
« on: July 15, 2009, 02:15:57 pm »
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

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 994
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: Detecting USB HID insertion and removal
« Reply #1 on: July 16, 2009, 07:15:54 am »
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
« Last Edit: July 17, 2009, 10:40:35 am by 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

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Detecting USB HID insertion and removal
« Reply #2 on: July 16, 2009, 01:49:52 pm »
thanks for the pointer.. works fine