一个系统空闲时间函数

提供一个系统空闲时间函数(ms),你可以用timer控件定时监测,如果系统空闲时间超过指定时间则做你想做的事:(系统空闲-指系统无任何操作,包括键盘和鼠标)
function LastInput:dword;
var
  LInput: TLastInputInfo;
begin
  LInput.cbsize := sizeof(TLastInputInfo);
  GetLastInputInfo(LInput);
  result := GetTickCount - LInput.dwtime;
end;    
posted @ 2008-04-05 15:05  delphi中间件  阅读(231)  评论(0编辑  收藏  举报