Tracking the mouse
-
I have a dialog based app that docks to the edge of the screen and auto-hides itself like the taskbar and I need to be able to tell when the mouse cursor hits the edge of the screen so I can restore my dialog. I've looked on MSDN but couldn't really find anything great, I know I can hack it and leave a corner of the dialog out and then show when the mouse enters (WM_MOUSEMOVE) but that isn't really what I want. Any help is greatly appreciated. Bret Faller Odyssey Computing, Inc.
-
I have a dialog based app that docks to the edge of the screen and auto-hides itself like the taskbar and I need to be able to tell when the mouse cursor hits the edge of the screen so I can restore my dialog. I've looked on MSDN but couldn't really find anything great, I know I can hack it and leave a corner of the dialog out and then show when the mouse enters (WM_MOUSEMOVE) but that isn't really what I want. Any help is greatly appreciated. Bret Faller Odyssey Computing, Inc.
I believe you're looking for GetMouseMovePointsEx and GetLastInputInfo These are the key API calls that you will need; and of course, you'll need knowledge of the screen size using GetSystemMetrics. CodeGuy http://groups.yahoo.com/group/wtl
-
I believe you're looking for GetMouseMovePointsEx and GetLastInputInfo These are the key API calls that you will need; and of course, you'll need knowledge of the screen size using GetSystemMetrics. CodeGuy http://groups.yahoo.com/group/wtl
Yeah, I've seen those functions but I need to continually monitor the mouse while my program is running, would that require another thread that only watches the mouse movements and what function would be a good place for these functions? Thanks for your response. Bret Faller Odyssey Computing, Inc.
-
Yeah, I've seen those functions but I need to continually monitor the mouse while my program is running, would that require another thread that only watches the mouse movements and what function would be a good place for these functions? Thanks for your response. Bret Faller Odyssey Computing, Inc.
I don't think I would bother with a thread. I'd investigate just using a timer function (i.e. handling WM_TIMER), since nothing is time critical about checking for mouse movements. Best regards, CodeGuy The WTL newsgroup: 860 members and growing ... http://groups.yahoo.com/group/wtl
-
I don't think I would bother with a thread. I'd investigate just using a timer function (i.e. handling WM_TIMER), since nothing is time critical about checking for mouse movements. Best regards, CodeGuy The WTL newsgroup: 860 members and growing ... http://groups.yahoo.com/group/wtl
Thanks, sounds good to me. Bret Faller Odyssey Computing, Inc.
-
I don't think I would bother with a thread. I'd investigate just using a timer function (i.e. handling WM_TIMER), since nothing is time critical about checking for mouse movements. Best regards, CodeGuy The WTL newsgroup: 860 members and growing ... http://groups.yahoo.com/group/wtl
One problem, for some reason there is no such thing as MOUSEMOVEPOINT structure in my header files. Any ideas? I did a find in files search and got nothing. Bret Faller Odyssey Computing, Inc.
-
One problem, for some reason there is no such thing as MOUSEMOVEPOINT structure in my header files. Any ideas? I did a find in files search and got nothing. Bret Faller Odyssey Computing, Inc.
Bret, I steered you wrong. :( The reason MOUSEMOVEPOINT is not available is because GetMouseMovePointsEx is a Win2000/Me API call. You would have to get the latest Platform SDK, but I suspect you would not want a solution for just those 2 operating systems. :) OK, well, this is more complicated, but you will have to do a Windows system hook to capture the mouse messages sent to the desktop. Take a look at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnmgmt/html/msdn\_hooks32.asp CodeGuy The WTL newsgroup: 860 members and growing ... http://groups.yahoo.com/group/wtl
-
Bret, I steered you wrong. :( The reason MOUSEMOVEPOINT is not available is because GetMouseMovePointsEx is a Win2000/Me API call. You would have to get the latest Platform SDK, but I suspect you would not want a solution for just those 2 operating systems. :) OK, well, this is more complicated, but you will have to do a Windows system hook to capture the mouse messages sent to the desktop. Take a look at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnmgmt/html/msdn\_hooks32.asp CodeGuy The WTL newsgroup: 860 members and growing ... http://groups.yahoo.com/group/wtl
Thanks for your help. Bret Faller Odyssey Computing, Inc.