I need to write a function so if the user doesn't do anything in 15 minutes,
it will log them out. I've got the timer set up fine I'm just looking for an
easy way to detect people doing anything. What's the easiest way to do it?
It looks like it may be mousemove on the windows. Is this reasonable?

TIA - Jeff.

Re: Detect any kind of activity in a window. by Gabriel

Gabriel
Wed Dec 07 06:34:38 CST 2005

The same question has been asked here this week my answer was to hook into
the keyboard and mouse using P/Invoke calls to the SetWindowsHookEx API:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/hooks/hookreference/hookfunctions/setwindowshookex.asp

Gabriel Lozano-Morán
MCSD .NET
Real Software
http://www.realdn.net
http://www.realsoftware.be



Re: Detect any kind of activity in a window. by Marc

Marc
Wed Dec 07 12:19:26 CST 2005

"UJ" <fred@nowhere.com> wrote in message
news:ef31Jzn%23FHA.1032@TK2MSFTNGP09.phx.gbl...
>I need to write a function so if the user doesn't do anything in 15
>minutes, it will log them out. I've got the timer set up fine I'm just
>looking for an easy way to detect people doing anything. What's the easiest
>way to do it? It looks like it may be mousemove on the windows. Is this
>reasonable?

I have used GetLastInputInfo to detect an idle user. Seems to work quite
well for me.

Marc
http://nomagichere.blogspot.com