Author Topic: need simple sample program notify when a usb device plugged  (Read 13449 times)

parrot

  • Member
  • ***
  • Posts: 3
need simple sample program notify when a usb device plugged
« on: April 28, 2012, 07:57:41 am »
hi! 
i want to write an application that will notify me that a specific usb deviced was plugged to the computer.
I'm new to programming and the only thing that i succeeded so far was to get WM_DEVICECHANGE message.
I read in the internet that when a usb is plugged and i get the WM_DEVICECHANGE message the wParam should be
DBT_DEVICEARRIVAL, but when i check it's value - it always 7 - both in plug and unplug the usb.
How can i overcome this so tha the app will notify me if the usb was plugged or unplugged?

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research