|
Can I get a program to run when a particular USB device is connected?
Can I get a program to run when a particular USB device is connected?
I am not a Windows driver programmer, so what I need is a generic
way to have Windows XP call my program when a particular device is
connected.
I suppose that there are at least two cases:
1. the driver is unique to the device
2. the driver is something used by many devices,
such as WINDOWS\system32\DRIVERS\disk.sys
My idea is that if someone inserts a USB device of the type
that I am tracking I would be able to log the event or send
an email or whatever.
Hmmm - sounds almost like a key logger, but:
a) it isn't,
b) the machine is mine anyhow,
and
c) if I wanted a keylogger there are probably about 5
that I could use.
It is OK if the solution involves taking an open source
keylogger and modifying it to do what I want, but the device
that I am interested in shows up as a mouse, not a key board.)
For now, however, the device that I am interested in shows up in
Device Manager under
"Human Interface Devices" -> "USB Human Interface Device"
and under
"Mice and other pointing devices" -> "HID-compliant mouse"
At least one of the driver routines is CURRENTLY only used
on my system by the device that I am interested in. I'd be
happy to have a solution that works for this case and worry
about what happens if I change my real mouse to one that
uses the same generic driver later.
I don't have to do anything to the device and timing
is not critical, so it might be possible for me to
have a "stub" routine which flips a bit and then goes
to the startup routine for the real driver. (I.e., I am
in case 2, but I can assume it is case 1.)
(I last played with driver routines around 1990, so
I have no idea how Windows XP does things. I'm just assuming
that Windows XP can do what (IBM) MFT, (DEC)
VMS and DEC's flavor of Unix each could do from 1967 to about
1990.)
|