Mouse Application Development (Windows Embedded CE 6.0)

1/6/2010

The mouse is an optional user-input device for Windows Embedded CE–based applications. Because many Windows Embedded CE–based devices rely on stylus input rather than mouse input to enhance portability, not every user necessarily has a mouse. An application can determine whether the system includes a mouse by calling the GetClipCursor function. A return value of TRUE indicates that a mouse is connected; FALSE indicates that a mouse is not connected.

When the user moves the mouse, the OS moves a bitmap on the screen called the mouse cursor. The mouse cursor contains a single–pixel point called the hot spot, which is a point that the OS tracks and recognizes as the position of the cursor. When a mouse event occurs, the window that contains the hot spot typically receives the mouse message resulting from the event. The window does not have to be active or have the keyboard focus to receive a mouse message.

The OS maintains a variable that controls mouse speed, which is the distance the cursor moves when the user moves the mouse. You can use the SystemParametersInfo function with the SPI_GETMOUSE or SPI_SETMOUSE flag to retrieve or set mouse speed.

Windows Embedded CE supports a mouse that has one, two, or three buttons. On a three–button mouse, the buttons are designated as the left, middle, and right buttons. Messages and named constants related to the mouse buttons use the letters L, M, and R to identify the buttons; for example, the WM_MBUTTONDOWN message relates to the middle button. The system treats the button on a single–button mouse as the left button. Although Windows Embedded CE supports a mouse with multiple buttons, most applications use the left button primarily and the others minimally, if at all.

In This Section

  • Receiving Mouse Messages
    Provides an overview of the messages that convey mouse input. Explains how double-clicks are recognized, and how to override the default application behavior to make it recognize and react to a double–click.
  • Mouse
    Provides an overview of the mouse support available for Windows Embedded CE.

See Also

Other Resources

Mouse