获取关机信息及键盘或鼠标无响应的时长
作者:互联网
procedure WMQUERYENDSESSON(var AMessage:TWMQueryEndSession);message WM_QUERYENDSESSION; //达到多少秒 function LeaveTimeBySeconds:Cardinal; 实现: procedure WMQUERYENDSESSON(var AMessage: TWMQueryEndSession); begin ShowMessage('要关机了'); end; function LeaveTimeBySeconds: Cardinal; var _last:tagLASTINPUTINFO; begin _last.cbSize:=SizeOf(tagLASTINPUTINFO); GetLastInputInfo(_last) ; Result := (GetTickCount-_last.dwTime) div 1000; end;
标签:function,关机,last,鼠标,Cardinal,AMessage,var,end,时长 来源: https://www.cnblogs.com/yagzh2000/p/13780388.html