×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

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

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

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

(OP)
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?

I'm flummoxed.

D

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

Hmmmm.... you could write a screen saver that sends "restart messages" (You define) to your program. It's easily disabled though...
Or you could start a timer within your program that is reset everytime there is mouse/keyboard activity. Use
SetTimer(hwnd, 1, 1000, NULL);
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.
Don't forget to KillTimer(hwnd, 1); before exiting your program.


Kim_Christensen@telus.net
Home Page

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

(OP)
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.

thanks again
D

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close