All Forums
 Microsoft Windows CE
 .NET Application Development
 Mouse detect
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Author Topic  

rsrumrill

20 Posts

Posted - 28 May 2008 :  11:42:09  Show Profile  Email Poster
Is there a way to programically (VB.net) detect if a USB mouse is connected? (VGX, CE5.0)

ctacke

877 Posts

Posted - 28 May 2008 :  11:45:54  Show Profile  Email Poster
You want to know if it's present, or setect when the state changes (inserted or removed)? I've never tried but I think the first may be done by looking in the registry at the HID driver - it likely builds some keys when the device is in. FOr the latter you can probably look at the device notification queue to get notified when the state changes (IIRC there's an example on these forums for doing similar when a USB storage device is inserted or removed).
Go to Top of Page

akidder

1519 Posts

Posted - 28 May 2008 :  12:04:19  Show Profile  Email Poster
I believe the application Chris is refering to is NotificationMonitor.exe at topic 2052.
Go to Top of Page

ctacke

877 Posts

Posted - 28 May 2008 :  12:07:31  Show Profile  Email Poster
Yep, that's it. A call to RequestDeviceNotifications with whatever GUID would be the pointer device.
Go to Top of Page

ctacke

877 Posts

Posted - 29 May 2008 :  09:39:05  Show Profile  Email Poster
It looks like you can probably walk the HKLM\Drivers\Active child keys and look for "HID1:" to detect the mouse - though I'm not sure if that would also show up for the keyboard as well.
Go to Top of Page
  Topic  
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Jump To:
Eurotech Support Forums © Eurotech Inc. Go To Top Of Page
This page was generated in 0.03 seconds. Snitz Forums 2000