As far as I know, there is no way to launch an exe when a device arrives. The standard idiom is to have a process register for notifications of your device interface class, using the RegisterDeviceNotification function. Your device should register one or more interfaces, and these identify the behaviors (contracts) between your device and programs that will use your device. If your device implements one of the well-known device interfaces (whose meaning, I/O control requests, and device interface GUID are documented in the DDK), then you’ll use the existing DDK device interface guids. If your device does something that only your program knows about, then you’ll need to create a new GUID to identify that interface.
In any case, RegisterDeviceNotification is what you want. You can have a system service wait for notifications, and then do whatever you want. Or, you can create a process that runs as the user, in the user’s session/desktop. You “pull” notifications from the PNP manager; the PNP manager does not “push” notifications or run programs on events.
From: xxxxx@lists.osr.com [xxxxx@lists.osr.com] On Behalf Of Amit Shahi [xxxxx@indiainfo.com]
Sent: Wednesday, May 16, 2007 3:18 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Launching an applicaion on USB attachement
Hi ,
I have an application which I want to invoked when I attached my USB device.
This USB device is requires BulkUsb driver.
My question is can Windows invoke an application exe automatically when I plug the USB?
Can I invoke the exe when my Driver is AddDevice or any other function is called ?
Thanks
Amit S
–
IndiaInfo Mail - the free e-mail service with a difference! www.indiainfo.com
Check out our value-added Premium features, such as an extra 20MB for mail storage, POP3, e-mail forwarding, and ads-free mailboxes!
Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer