|
-
March 20th, 2006, 05:52 AM
#1
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.
-
March 20th, 2006, 06:22 AM
#2
Re: MFC Event Message Problem
i think GetCursorPos Function should do the trick for you.
hope this helps ya
- Sreehari
"Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us."
" Everybody is sent to Earth on a purpose. I am so Lagging behind that i won't die." – Calvin
-
March 20th, 2006, 07:10 AM
#3
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
-
March 20th, 2006, 07:21 AM
#4
Re: MFC Event Message Problem
Best regards,
Igor
-
March 20th, 2006, 06:30 PM
#5
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|