Share via


Mouse Application Development (Windows CE 5.0)

Send Feedback

The mouse is an optional user-input device for Windows CE–based applications. Because many Windows 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 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 CE supports a mouse with multiple buttons, most applications use the left button primarily and the others minimally, if at all.

In this Section

Capturing Mouse Input

Receiving Mouse Messages

Mouse OS Design Development

Mouse (User Interface)

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.