Re: How to show/hide cursor on attach/deattach usb mouse
- From: "Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT com>
- Date: Wed, 26 Nov 2008 09:06:48 -0700
Well, since I need it in both mouhid and the display driver, I put it in a
platform-specific header file, devclassmouse.h, in case you're curious. I
could not use the IClass registry entry and make it work, because I was
starting with the PS/2 mouse, so I'm not 100% sure about that for the USB
case.
Paul T.
"paolo patierno" <paolopatierno@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:C35E55B8-75E2-48C2-B777-32C7604BCD73@xxxxxxxxxxxxxxxx
Can you give me other information.
In which file did you add the #define ?
Can I use the registry key HID mouse and setting its IClass = GUID instead
of call AdvertiseInterface in the mouse driver ?
Thanks very much....
"Paul G. Tobey [eMVP]" wrote:
I did this myself by, as you seem to be doing, cloning mouhid and
arranging
for it to notify the system that a mouse was attached
(AdvertiseInterface).
Here's the class I used for that:
#define DEVCLASS_MOUSE_GUID_STRING
TEXT("{FFBE5A05-87B4-4591-B067-CEBA6FAFD298}")
#define DEVCLASS_MOUSE_GUID { 0xFFBE5A05, 0x87B4, 0x4591, { 0xB0, 0x67,
0xCE, 0xBA, 0x6F, 0xAF, 0xD2, 0x98 } }
This particular GUID was suggested as a de facto standard by Steve
Maillet a
while back, so I used it.
To actually turn the cursor on and off, which is a function of the
display
driver, I modified my display driver to use RequestDeviceNotifications:
GUID devguid = DEVCLASS_MOUSE_GUID;
// Ask for device notifications to be sent. Note that we set the
// last parameter to true to indicate that we want notifications
// for devices already connected.
notH = RequestDeviceNotifications( &devguid, msgQ, TRUE );
and so on. Of course, it asks for all device events, even those for
devices
that were attached before the display driver was executed, since you
don't
want to depend on the mouse to be advertised *after* the display driver
requested notifications. In the handler for a notification of the mouse,
I
do the right thing to turn cursor display in the driver on/off.
Paul T.
"paolo patierno" <paolopatierno@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message
news:B7E6AE51-BE98-470E-87AE-CD484DFF6C89@xxxxxxxxxxxxxxxx
hi,
I want to develop a windows ce service who received notifications on
usb
mouse attach/deattach and then show/hide the cursor. I read that I must
add a
GUID (IClass) to mouhid.dll (i must clone it) and then use
RequestDeviceNotifications.
Can I have some help !?
Thanks...
.
- Follow-Ups:
- Re: How to show/hide cursor on attach/deattach usb mouse
- From: paolo patierno
- Re: How to show/hide cursor on attach/deattach usb mouse
- References:
- How to show/hide cursor on attach/deattach usb mouse
- From: paolo patierno
- Re: How to show/hide cursor on attach/deattach usb mouse
- From: Paul G. Tobey [eMVP]
- Re: How to show/hide cursor on attach/deattach usb mouse
- From: paolo patierno
- How to show/hide cursor on attach/deattach usb mouse
- Prev by Date: Re: Cloning WinCE 5.0 component
- Next by Date: Re: Cloning WinCE 5.0 component
- Previous by thread: Re: How to show/hide cursor on attach/deattach usb mouse
- Next by thread: Re: How to show/hide cursor on attach/deattach usb mouse
- Index(es):
Relevant Pages
|