MFC Event Message Problem
Hello.
I am trying to write a simple MFC program to show the current cursor position. I am using OnMouseMove() to do this right now but it is only giving me the postion of the cursor when it is over the window. Is there a function that will pass a message when the mouse moves anywhere on the screen? Is there a way for me to define a custom event? I welcome any information or pointers to other resources. Thanks.
Re: MFC Event Message Problem
i think GetCursorPos Function should do the trick for you.
hope this helps ya :D
Re: MFC Event Message Problem
You can use a pooling mechanism like sreehari offered in which you will need to call each interval to ::GetCursorPos() to check where the cursor is.
Another option is to use mouse hook using ::SetWindowsHookEx() with WH_MOUSE.
Cheers
Re: MFC Event Message Problem
Re: MFC Event Message Problem
::SetWindowsHookEx() is what I was looking for, and it should help me with some other things I am trying to accomplish. Thank you very much for all of your replies.