delphi获取闲置时间

function GetLastInput: integer; //获取闲置时间
var
  LInput: TLastInputInfo;
begin
  Result := 0;
  try
    LInput.cbSize := SizeOf(TLastInputInfo);
    GetLastInputInfo(LInput);
    Result := ((GetTickCount - LInput.dwTime) div 1000);
  except
  end;
end; 

你可能感兴趣的:(delphi获取闲置时间)