一个系统空闲时间函数

提供一个系统空闲时间函数(ms),你可以用timer控件定时监测,如果系统空闲时间超过指定时间则做你想做的事:(系统空闲-指系统无任何操作,包括键盘和鼠标)
function LastInput:dword;
var
  LInput: TLastInputInfo;
begin
  LInput.cbsize := sizeof(TLastInputInfo);
  GetLastInputInfo(LInput);
  result := GetTickCount - LInput.dwtime;
end;    
原文地址:https://www.cnblogs.com/hnxxcxg/p/2940891.html