Ports
May 19, 2013, 10:19:24 am *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: SMF - Just Installed!
 
   Home   Help Search Login Register  
Welcome to the PORTS Forum. Please post your questions, answers, and comments relating to USB and other hardware interfaces in the appropriate forums below. - Jan
Pages: [1]
  Print  
Author Topic: need simple sample program notify when a usb device plugged  (Read 771 times)
parrot
Member
*
Posts: 3


« on: April 28, 2012, 06: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?
Logged
Jan Axelson
Administrator
Frequent Contributor
*****
Posts: 1625


WWW
« Reply #1 on: April 28, 2012, 11:48:27 am »

See my example code:

http://www.lvr.com/hidpage.htm#MyExampleCode

http://www.lvr.com/winusb.htm

Jan
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!