That's certainly a system-level behavior that should come as a standard
behavior. If your device doesn't already do that, I'd be complaining the
the OEM's support channel.
--
Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded community
http://community.OpenNETCF.com
"Alessandro" <(E-Mail Removed)> wrote in message
news:85e831bf-5282-415e-8caa-(E-Mail Removed)...
On Jun 16, 7:39 pm, "Paul G. Tobey [eMVP]" <p space tobey no spam AT
no instrument no spam DOT com> wrote:
> I'd say that you probably can't. On our devices, we have a special class
> that is sent via that notification for the mouse, specifically, being
> inserted and removed.
>
> It sounds to me like you should be saying something about what the actual
> system behavior is. Does the device already handle showing and hiding the
> cursor for you when a mouse is connected? It sounds like your answer is
> "no". If that's the case, I'm not sure that Cursor.Show will do anything
> for you. Give us a little more information about how the device actually
> works, completely aside from your application, with respect to the mouse
> cursor. That will probably tell us enough to suggest what you'll have to
> do.
>
> Paul T.
>
> "Alessandro" <brambi...@elsyst.it> wrote in message
>
> news:604b90aa-40f4-408d-b4e9-(E-Mail Removed)...
>
> > Hi to all
>
> > I develop with VB.NET 2005 on WinCE 6.0 platform. By default the USB
> > mouse is not plugged and the cursor is hidden. I want to show the
> > cursor when the mouse is plugged and hide the cursor when the mouse is
> > unplugged.
> > To show/hide the cursor I can use the Cursor.Show and Cursor.Hide
> > methods. To detect plug/unplug I have tried to use the
> > OpenNETCF.WindowsCE.DeviceStatusMonitor class. This is my code:
>
> > Public Class frmMain
>
> > Dim WithEvents monitor As OpenNETCF.WindowsCE.DeviceStatusMonitor
> > = New OpenNETCF.WindowsCE.DeviceStatusMonitor(DeviceClass.Any, False)
> > Delegate Sub AddMessage(ByVal msg As String)
> > Private myDelegate As AddMessage = New AddMessage(AddressOf
> > ShowMessage)
>
> > Private Sub StatusChanged(ByVal sender As Object, ByVal e As
> > DeviceNotificationArgs) Handles monitor.DeviceNotification
> > Dim message As String = String.Format("Device '{0}' has been
> > {1}.", e.DeviceName, IIf(e.DeviceAttached, "inserted",
> > "removed").ToString)
> > message &= vbCrLf & "Device Class = " & e.DeviceClass.ToString
> > & " - DeviceInterfaceGUID = " & e.DeviceInterfaceGUID.ToString
> > Invoke(myDelegate, message)
> > End Sub
>
> > Private Sub ShowMessage(ByVal msg As String)
> > txtMsg.Text &= msg & vbCrLf
> > End Sub
>
> > Private Sub btnStart_Click(ByVal sender As System.Object, ByVal e
> > As System.EventArgs) Handles btnStart.Click
> > If monitor.Active Then Exit Sub
> > monitor.StartStatusMonitoring()
> > lblMonitor.Text = "--> M O N I T O R I N G <--"
> > End Sub
>
> > Private Sub btnStop_Click(ByVal sender As System.Object, ByVal e
> > As System.EventArgs) Handles btnStop.Click
> > If Not monitor.Active Then Exit Sub
> > monitor.StopStatusMonitoring()
> > lblMonitor.Text = "--> S T O P P E D <--"
> > End Sub
>
> > Private Sub frmMain_Closing(ByVal sender As Object, ByVal e As
> > System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
> > monitor.Dispose()
> > End Sub
>
> > End Class
>
> > When I plug the USB mouse I receive this message:
>
> > "Device 'HID1:' has been inserted.
> > Device Class = StreamDevice - DeviceInterfaceGUID =
> > f8a6ba98-087a-43ac-a9d8-b7f13c5bae31
>
> > BUT if i plug an USB keyboard before the USB mouse I receive two
> > message for the keyboard and no message when I plug the mouse. The two
> > message (keyboard) are:
>
> > Device 'HID1:' has been inserted.
> > Device Class = StreamDevice - DeviceInterfaceGUID =
> > f8a6ba98-087a-43ac-a9d8-b7f13c5bae31
> > Device 'KBD1:' has been inserted.
> > Device Class = Keyboard - DeviceInterfaceGUID = cbe6ddf2-
> > f5d4-4e16-9f61-4ccc0b6695f3
>
> > How can I detect the connection/disconnection of a USB mouse WITHOUT
> > modify the mouse driver ?
> > (I don't program with C-language and it is difficult for me to modify
> > the driver).
>
> > Thankyou very much!
> > Ale
Hi Paul, thaks for your reply.
The mouse works fine and Cursor.Hide/Show works fine too.
I have a x86 device with some USB port. We have only one full screen
application.
The device have a touch screen.
I hope this informations help you to understand.
Thanks in advance!
Ale