Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

C++: Detecting mouse/keyb activity from off form-ie screensaver

Status
Not open for further replies.

Donald

Programmer
Mar 13, 2000
15
0
0
CA
I'm running some login forms that need to restart in case a user walks away from a terminal. Any ideas about detecting inactivity when the application is minimized or hidden?<br>
<br>
I'm flummoxed.<br>
<br>
D
 
Hmmmm.... you could write a screen saver that sends &quot;restart messages&quot; (You define) to your program. It's easily disabled though...<br>
Or you could start a timer within your program that is reset everytime there is mouse/keyboard activity. Use<br>
SetTimer(hwnd, 1, 1000, NULL); <br>
This will send WM_TIMER messages to your program every second. Next, increment a varable for the desired # of seconds & reset the variable only when the window has input focus / user input.<br>
Don't forget to KillTimer(hwnd, 1); before exiting your program.<br>
<p> <br><a href=mailto:Kim_Christensen@telus.net>Kim_Christensen@telus.net</a><br><a href= Page</a><br>
 
Thanks for the suggestion. I decided to use a small screensaver app to run my app, or even run the whole thing as a screensaver. Not secure but security isn't important for this thingy.<br>
<br>
thanks again<br>
D
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top