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));

posted on 2009-01-09 10:08  discboy  阅读(384)  评论(0编辑  收藏  举报