Skip to main content.

GetMessagePos vs. GetCursorPos

It is sometimes necessary to retrieve the position of the cursor within a child control (i.e. TreeView, ListView, etc.)

GetMessagePos will return the position of the cursor when the message was added to the message queue. GetCursorPos will return the current position of the cursor (that can have changed since the message was handled by the application.)

It is better to use GetMessagePos as it will improve how the application reacts to the user action (particularly handling the right-click button.)

Comments

No comments yet

Add Comment

You must be logged in as a member to add comment to this blog