ChrisJonesLycos
asked on
Detecting Idle Time in Delphi
I have an app that needs to detect when the whole system has not received any input from keyboard or mouse for a few minutes. I've found some very complicated hooking examples online which involve DLLs and some others that simply don't work. Can anyone suggest a straight forward way of doing this.
ASKER
The MSDN documentation says that that's for your own window only, not system wide.
No wait, it says literaly "GetLastInputInfo does not provide system-wide user input information across all running sessions. Rather, GetLastInputInfo provides session-specific user input information for only the session that invoked the function"
It speaks about sessions, not "window"
It speaks about sessions, not "window"
ASKER
Is that not the same? I'll try out some code and see what result I get.
For a session I mean a User session. If you have some user remotely connected that's a separate session I guess. It's like it works into HKCU instead of HKLM
Anyway, everywhere I read, the suggested approach for a system idle detection is this.
Anyway, everywhere I read, the suggested approach for a system idle detection is this.
ASKER
I've requested that this question be closed as follows:
Accepted answer: 0 points for ChrisJonesLycos's comment #37782640
for the following reason:
Cool. You're right, code works! Session obviously doesn't mean just your own app, it's definitely system wide. Many thanks.
Accepted answer: 0 points for ChrisJonesLycos's comment #37782640
for the following reason:
Cool. You're right, code works! Session obviously doesn't mean just your own app, it's definitely system wide. Many thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I accepted your solution. Not sure what happened.
edit: you need it systemwide, so this function can't help you :(
Open in new window