There might be a more elegant way, but in general you can do this:

Set up an InactivityTimer with the code you want to execute when the user is
inactive, and set its interval to be the timeout period.

Set up an ActivityTimer with a fairly short interval (300 ms, for example),
repeating. Each time the timer fires, check whether any keys are being held
down and whether the mouse XY coordinates have changed since the last time
this fired. If so, reset the InactivityTimer so that it starts counting from
zero again. Your activity detector should execute quickly enough that there
won't be a noticeable impact on system performance.

That's just off the top of my head, so take it for what it's worth.

On 5/16/07, Jim Dossey <[EMAIL PROTECTED]> wrote:
>
> Does anybody know how, in Windows, to tell if the user is inactive for
> some
> period of time?  I need to do something like most IM clients do where if
> the
> user is inactive for a set number of minutes it triggers some event.  I
> searched the archives but couldn't find anything about an inactive user.
>
> Thanks,
> Jim
> _______________________________________________
> Unsubscribe or switch delivery mode:
> <http://www.realsoftware.com/support/listmanager/>
>
> Search the archives:
> <http://support.realsoftware.com/listarchives/lists.html>
>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to