Partager via


Mouse Application Development

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

Windows® phones rely on stylus or touch input rather than mouse input to enhance portability. Applications, however, process stylus events as a click of the left mouse button, so adding support for mouse input to your OS design can provide broader capabilities through the support of the additional buttons and mouse wheel.

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.

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.