Skip to content

Latest commit

 

History

History
125 lines (78 loc) · 4.35 KB

nf-winuser-getmessagepos.md

File metadata and controls

125 lines (78 loc) · 4.35 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name req.apiset
NF:winuser.GetMessagePos
GetMessagePos function (winuser.h)
Retrieves the cursor position for the last message retrieved by the GetMessage function.
GetMessagePos
GetMessagePos function [Windows and Messages]
_win32_GetMessagePos
_win32_getmessagepos_cpp
winmsg.getmessagepos
winui._win32_getmessagepos
winuser/GetMessagePos
winmsg\getmessagepos.htm
winmsg
VS|winui|~\winui\windowsuserinterface\windowing\messagesandmessagequeues\messagesandmessagequeuesreference\messagesandmessagequeuesfunctions\getmessagepos.htm
12/05/2018
GetMessagePos, GetMessagePos function [Windows and Messages], _win32_GetMessagePos, _win32_getmessagepos_cpp, winmsg.getmessagepos, winui._win32_getmessagepos, winuser/GetMessagePos
winuser.h
Windows.h
Windows
Windows 2000 Professional [desktop apps only]
Windows 2000 Server [desktop apps only]
User32.lib
User32.dll
Windows
19H1
GetMessagePos
winuser/GetMessagePos
c++
APIRef
kbSyntax
DllExport
User32.dll
API-MS-Win-NTUser-IE-message-l1-1-0.dll
ie_shims.dll
API-MS-Win-RTCore-NTUser-Window-l1-1-0.dll
minuser.dll
Ext-MS-Win-NTUser-message-l1-1-1.dll
Ext-MS-Win-RTCore-NTUser-Window-Ext-l1-1-0.dll
Ext-MS-Win-NTUser-Message-l1-1-2.dll
Ext-MS-Win-NTUser-Message-L1-1-3.dll
GetMessagePos
ext-ms-win-ntuser-message-l1-1-1 (introduced in Windows 8.1)

GetMessagePos function

-description

Retrieves the cursor position for the last message retrieved by the GetMessage function.

To determine the current position of the cursor, use the GetCursorPos function.

-returns

Type: DWORD

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

-remarks

As noted above, the x-coordinate is in the low-order short of the return value; the y-coordinate is in the high-order short (both represent signed values because they can take negative values on systems with multiple monitors). If the return value is assigned to a variable, you can use the MAKEPOINTS macro to obtain a POINTS structure from the return value. You can also use the GET_X_LPARAM or GET_Y_LPARAM macro to extract the x- or y-coordinate.

Important  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 monitors can have negative x- and y- coordinates, and LOWORD and HIWORD treat the coordinates as unsigned quantities.
 

-see-also

Conceptual

GetCursorPos

GetMessage

GetMessageTime

HIWORD

LOWORD

MAKEPOINTS

Messages and Message Queues

Other Resources

POINTS

Reference