GetIdleTime (Windows CE 5.0)
This function returns the amount of time, in milliseconds, that the system has been idle.
DWORD GetIdleTime (void);
The number of milliseconds that the system has been idle. If GetIdleTime returns MAXDWORD, functionality is not supported by your platform.
GetIdleTime returns an idle time equivalent to (DWORD) ((((ULONGLONG) curridlehigh) << 32 + curridlelow) / idleconv).
If idleconv is set to 0, then GetIdleTime is not implemented and the kernel returns MAXDWORD. If idleconv is set to a non-zero value, then this API is implemented and the OAL must update curridlelow and curridlehigh correctly.
The following code example shows how to determine how long the device has idled by wrapping a call to GetIdleTime with calls to GetTickCount.
dwStartTick = GetTickCount(); dwIdleSt = GetIdleTime(); // Insert a call to the Sleep(sleep_time) function to allow idle time // to accrue. An example of an appropriate sleep time is 1000 ms. dwStopTick = GetTickCount(); dwIdleEd = GetIdleTime(); PercentIdle = ((100*(dwIdleEd - dwIdleSt)) / (dwStopTick - dwStartTick));
OS Versions: Windows CE 3.0 and later.
Link Library: Coredll.lib.
Send Feedback on this topic to the authors