How do I detect any mouse/key input at application level
-
How do I detect any mouse/key input at application level. I have an MDI application where processing of mouse/key events are handled in view/doc class of the child window. I need to check if any mouse/key input didn't occured for a specific time period. I want to handle them in application or MDI so that I can only in one place. But I am getting only WM_MOUSEACTIVATE, WM_SETCURSOR messages in MDI level. Please help with any suggestion/idea. Thanks in advance
Sandip
-
How do I detect any mouse/key input at application level. I have an MDI application where processing of mouse/key events are handled in view/doc class of the child window. I need to check if any mouse/key input didn't occured for a specific time period. I want to handle them in application or MDI so that I can only in one place. But I am getting only WM_MOUSEACTIVATE, WM_SETCURSOR messages in MDI level. Please help with any suggestion/idea. Thanks in advance
Sandip
Install a mouse hook locally in your application using
SetWindowsHookEx
. Start a timer that increments a variable. Whenever a mouse message occurs the hook procedure will be called. In the hook procedure reset the variable to 0. Do the same for keyboard with a keyboard hook.«_Superman_» I love work. It gives me something to do between weekends.
-
How do I detect any mouse/key input at application level. I have an MDI application where processing of mouse/key events are handled in view/doc class of the child window. I need to check if any mouse/key input didn't occured for a specific time period. I want to handle them in application or MDI so that I can only in one place. But I am getting only WM_MOUSEACTIVATE, WM_SETCURSOR messages in MDI level. Please help with any suggestion/idea. Thanks in advance
Sandip
g_sandipan wrote:
I need to check if any mouse/key input didn't occured for a specific time period.
GetLastInputInfo[^] is useful to detect input idle time.
Nibu babu thomas Microsoft MVP for VC++ Code must be written to be read, not by the compiler, but by another human being. Programming Blog: http://nibuthomas.wordpress.com
-
g_sandipan wrote:
I need to check if any mouse/key input didn't occured for a specific time period.
GetLastInputInfo[^] is useful to detect input idle time.
Nibu babu thomas Microsoft MVP for VC++ Code must be written to be read, not by the compiler, but by another human being. Programming Blog: http://nibuthomas.wordpress.com
For that u need to user TIMER, on Application startup u need to start it, and if any MOUSE/key input occurred, then u need to again restart the timer. :) Regards, Sunil
-
Install a mouse hook locally in your application using
SetWindowsHookEx
. Start a timer that increments a variable. Whenever a mouse message occurs the hook procedure will be called. In the hook procedure reset the variable to 0. Do the same for keyboard with a keyboard hook.«_Superman_» I love work. It gives me something to do between weekends.
Thanks for the advice...
Sandip