开发者

Idle time of an application

how to calculate idle time of an application in mfc.

If an application session has been idle for more than 15 minutes how to re-authenticate 开发者_运维问答session.


You need the "GetLastInputInfo" API.

UINT GetIdleMS()
{
   LASTINPUTINFO li = { 0 };
   li.cbSize        = sizeof(LASTINPUTINFO);
   GetLastInputInfo(&li);
   return GetTickCount() - li.dwTime;
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜