Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This function returns a long value that gives the cursor position in screen coordinates.

Syntax

DWORD GetMessagePos(void);

Return Value

The return value specifies the x- and y-coordinates of the cursor position. The x-coordinate is the low order intand the y-coordinate is the high-order int.

Remarks

As noted above, the x-coordinate is in the low-order intof the return value; the y-coordinate is in the high-order int(both represent signedvalues because they can take negative values on systems with multiple monitors).

For platforms that use a stylus rather than a mouse, the cursor position is the position of the stylus on the touch screen when the last message retrieved by the GetMessagefunction occurred.

To determine the current position of the cursor instead of the position when the last message occurred, use the GetCursorPosfunction.

Requirements

Header winuser.h
Library coredll.lib
Windows Embedded CE Windows CE 1.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also