How to use GetLastInputInfo?
-
Hello all, Can someone post some sample code on using GetLastInputInfo? i.e., how to calculate the idle time of the application in MINUTES? Thanks in advance.
-
Hello all, Can someone post some sample code on using GetLastInputInfo? i.e., how to calculate the idle time of the application in MINUTES? Thanks in advance.
Hi, The LASTINPUTINFO structure contains the tick count when the last input event occurred. You would use the [^] GetTickCount function[^] function to get current tick count and then subtract the value obtained from
LASTINPUTINFO.dwTime
to obtain the number of milliseconds since the last input event. This value divided by 1000 would obviously be the number of seconds since the last input event occurred. Best Wishes, -David Delaune -
Hi, The LASTINPUTINFO structure contains the tick count when the last input event occurred. You would use the [^] GetTickCount function[^] function to get current tick count and then subtract the value obtained from
LASTINPUTINFO.dwTime
to obtain the number of milliseconds since the last input event. This value divided by 1000 would obviously be the number of seconds since the last input event occurred. Best Wishes, -David DelauneThanks This thread is done.