GetMessagePos

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

At a Glance

Header file: Winuser.h
Windows CE versions: 1.0 and later

Syntax

DWORD GetMessagePos(void);

Return Values

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

Remarks

As noted above, the x-coordinate is in the low-order int of the return value; the y-coordinate is in the high-order int (both represent signed values 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 GetMessage function occurred.

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

Do not use the LOWORD or HIWORD macros to extract the x- and y- coordinates of the cursor position because these macros return incorrect results on systems with multiple monitors. Systems with multiple monitor systems can have negative x- and y- coordinates, and LOWORD and HIWORD treat the coordinates as unsigned quantities.

See Also

GetMessage