PDA

View Full Version : USB device detection problem



yellowmat
25th July 2006, 16:18
He everybody,

I have an application that uses an usb device. Sometimes this device is not recognized at startup so my application does not work well and I am oblige to deconnect and reconnect it manually.

My application can detect whether or not the device has been recognized so I wonder if it is possible to send a message to the system (I am working with Windows XP and 2000) to force it to scan all usb devices connected.

I've just seen a message called DBT_CONFIGCHANGED that could solve my problem but I am not sure.

Does anyone have tryed such a thing ?

Thanks in advance.

wysota
19th August 2006, 12:04
You can use any WinAPI calls you want in your application, so you might use SendMessage() or PostMessage() (or whatever other call appropriate) to do the job.