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;
}
精彩评论