I read this in an '04 post from Lance.
Reading this, I'd assume that I could use GetMessagePos in a callback to get mouse position while responding to a message.
But how do I know that the GetMessagePos is sync'd to a message in the callback function? Does my app go on hold, not calling the next message in the queue, and is not using GetMessage() again, such that I'm guaranteed that GetMessagePos corresponds to the message I'm responding to in the callback?
I don't know enough about what goes on in the background to know that nothing else will use GetMessage(), thus making GetMessagePos correspond to a different message.
And in general, even if GetMessagePos is the most accurate approach, is there any practical difference? Has someone used GetCursorPos instead of GetMessagePos and seen a specific "bad" result because of it? At the speed messages come to my app, my first guess would be that the difference is trivial, but I just don't know for sure.
In the samples distributed with PBWin, GetCursorPos is used mostly. I only saw GetMessagePos wasn't used at all.
For example, if you want to know <U>where the cursor was positioned when the current message was generated/queued</U> then use the GetMessagePos() API {as opposed to GetCursorPos() which may only tell you where the cursor has wandered off to in the time between the current message being generated and when the Callback Function/WndProc() code would call GetCursorPos()}
But how do I know that the GetMessagePos is sync'd to a message in the callback function? Does my app go on hold, not calling the next message in the queue, and is not using GetMessage() again, such that I'm guaranteed that GetMessagePos corresponds to the message I'm responding to in the callback?
I don't know enough about what goes on in the background to know that nothing else will use GetMessage(), thus making GetMessagePos correspond to a different message.
And in general, even if GetMessagePos is the most accurate approach, is there any practical difference? Has someone used GetCursorPos instead of GetMessagePos and seen a specific "bad" result because of it? At the speed messages come to my app, my first guess would be that the difference is trivial, but I just don't know for sure.
In the samples distributed with PBWin, GetCursorPos is used mostly. I only saw GetMessagePos wasn't used at all.
Comment