User Idle Time 
Author Message
 User Idle Time

Hi,

Is there some function that tells how long the user has been idle (no input
from keyboard, mouse and other things)?

--

Olaf van der Spek
Almere, Holland

http://www.*-*-*.com/



Fri, 04 Oct 2002 03:00:00 GMT  
 User Idle Time
I don't know if there is a better way, but you can create a Count variable that
increments in the app's OnIdle event handler.

Hope that helps,
Dell


Quote:
> Hi,

> Is there some function that tells how long the user has been idle (no input
> from keyboard, mouse and other things)?

> --

> Olaf van der Spek
> Almere, Holland

> http://xcc.tiberian.com/



Fri, 04 Oct 2002 03:00:00 GMT  
 User Idle Time


Quote:
> I don't know if there is a better way, but you can create a Count variable
that
> increments in the app's OnIdle event handler.

That only says how much my app has been idle, not how long the user has been
idle.

Quote:

> Hope that helps,
> Dell


> > Hi,

> > Is there some function that tells how long the user has been idle (no
input
> > from keyboard, mouse and other things)?

> > --

> > Olaf van der Spek
> > Almere, Holland

> > http://xcc.tiberian.com/



Sat, 05 Oct 2002 03:00:00 GMT  
 User Idle Time
creating a keyboard hook and a mouse hook maybe???



Quote:
> Hi,

> Is there some function that tells how long the user has been idle (no
input
> from keyboard, mouse and other things)?

> --

> Olaf van der Spek
> Almere, Holland

> http://xcc.tiberian.com/



Sat, 05 Oct 2002 03:00:00 GMT  
 User Idle Time
I assumed there must be a simpler way.



Quote:
> creating a keyboard hook and a mouse hook maybe???



> > Hi,

> > Is there some function that tells how long the user has been idle (no
> input
> > from keyboard, mouse and other things)?

> > --

> > Olaf van der Spek
> > Almere, Holland

> > http://xcc.tiberian.com/



Sat, 05 Oct 2002 03:00:00 GMT  
 User Idle Time
Unfortunately, there is not. Also, other programs wait for what they
think is idle, and start doing background processing.


Quote:

> I assumed there must be a simpler way.



> > creating a keyboard hook and a mouse hook maybe???



> > > Hi,

> > > Is there some function that tells how long the user has been idle (no
> > input
> > > from keyboard, mouse and other things)?



Sat, 05 Oct 2002 03:00:00 GMT  
 User Idle Time
I don't want to do background processing, but something when the user is
away.
Do you know of an example that uses the keyboard and mouse hooks?



Quote:
> Unfortunately, there is not. Also, other programs wait for what they
> think is idle, and start doing background processing.


> > I assumed there must be a simpler way.



> > > creating a keyboard hook and a mouse hook maybe???



> > > > Hi,

> > > > Is there some function that tells how long the user has been idle
(no
> > > input
> > > > from keyboard, mouse and other things)?



Sat, 05 Oct 2002 03:00:00 GMT  
 User Idle Time
Well, if you aren't afraid of a working with the functions PSAPI.DLL you
could do the following:

1. Call EnumProcesses() to get a list of processes

2. Iterate through those processes until you find the System Idle Process

3. Open the idle process -- via ::OpenProcess(), I believe.

3. Call ::GetProcessTimes() on that process.

This will at least give you the amount of time the idle process has been
running.  Note that it runs regardless of whether or not anyone has been
logged on, so it may not be exactly the number you want.

Joe



Quote:
> I don't want to do background processing, but something when the user is
> away.
> Do you know of an example that uses the keyboard and mouse hooks?



> > Unfortunately, there is not. Also, other programs wait for what they
> > think is idle, and start doing background processing.


> > > I assumed there must be a simpler way.



> > > > creating a keyboard hook and a mouse hook maybe???



> > > > > Hi,

> > > > > Is there some function that tells how long the user has been idle
> (no
> > > > input
> > > > > from keyboard, mouse and other things)?



Sat, 05 Oct 2002 03:00:00 GMT  
 User Idle Time



Quote:
> Well, if you aren't afraid of a working with the functions PSAPI.DLL you
> could do the following:

Does that also work for Windows 98?

Quote:

> 1. Call EnumProcesses() to get a list of processes

> 2. Iterate through those processes until you find the System Idle Process

> 3. Open the idle process -- via ::OpenProcess(), I believe.

> 3. Call ::GetProcessTimes() on that process.

> This will at least give you the amount of time the idle process has been
> running.  Note that it runs regardless of whether or not anyone has been
> logged on, so it may not be exactly the number you want.

> Joe



> > I don't want to do background processing, but something when the user is
> > away.
> > Do you know of an example that uses the keyboard and mouse hooks?



> > > Unfortunately, there is not. Also, other programs wait for what they
> > > think is idle, and start doing background processing.


> > > > I assumed there must be a simpler way.



> > > > > creating a keyboard hook and a mouse hook maybe???



> > > > > > Hi,

> > > > > > Is there some function that tells how long the user has been
idle
> > (no
> > > > > input
> > > > > > from keyboard, mouse and other things)?



Sun, 06 Oct 2002 03:00:00 GMT  
 User Idle Time


Quote:

> I don't want to do background processing, but something when the user is
> away.

The easiest thing would be to make your program a screensaver.


Sun, 06 Oct 2002 03:00:00 GMT  
 User Idle Time
I believe that Win98 has the equivalent functins in ToolHelp32.dll.

Search the MSDN for ToolHelp.

Joe



Quote:



> > Well, if you aren't afraid of a working with the functions PSAPI.DLL you
> > could do the following:

> Does that also work for Windows 98?

> > 1. Call EnumProcesses() to get a list of processes

> > 2. Iterate through those processes until you find the System Idle
Process

> > 3. Open the idle process -- via ::OpenProcess(), I believe.

> > 3. Call ::GetProcessTimes() on that process.

> > This will at least give you the amount of time the idle process has been
> > running.  Note that it runs regardless of whether or not anyone has been
> > logged on, so it may not be exactly the number you want.

> > Joe



> > > I don't want to do background processing, but something when the user
is
> > > away.
> > > Do you know of an example that uses the keyboard and mouse hooks?



> > > > Unfortunately, there is not. Also, other programs wait for what they
> > > > think is idle, and start doing background processing.


> > > > > I assumed there must be a simpler way.



> > > > > > creating a keyboard hook and a mouse hook maybe???



> > > > > > > Hi,

> > > > > > > Is there some function that tells how long the user has been
> idle
> > > (no
> > > > > > input
> > > > > > > from keyboard, mouse and other things)?



Sun, 06 Oct 2002 03:00:00 GMT  
 
 [ 11 post ] 

 Relevant Pages 

1. How to obtain the login time and the idle time of the user

2. how to obtain the login time and the idle time of the users

3. Idle time/User Interface question

4. How to get system idle time or get notified after the system being idle for an extended time

5. How to get system idle time or get notified after the system being idle for an extended time

6. I want detect when the user is idle

7. idle users

8. System Idle time

9. Idle Times

10. Get Total Idle Time

11. idle time

12. System Idle Time modification...

 

 
Powered by phpBB® Forum Software