开发者

Idle time of an application

开发者 https://www.devze.com 2023-01-31 23:55 出处:网络
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

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

精彩评论

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