SecondsIdle函数返回问题
function SecondsIdle: DWord;
var
liInfo: TLastInputInfo;
begin
liInfo.cbSize := SizeOf(TLastInputInfo) ;
GetLastInputInfo(liInfo) ;
Result := (GetTickCount - liInfo.dwTime) DIV 1000;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
Caption := Format('System IDLE last %d seconds', [SecondsIdle]) ;
if SecondsIdle >=5 then
Begin
MessageBox(0,'>=5','提示',MB_OK);
end;
end;
end.
--------------------------------------------------------------------------------------
如何让
if SecondsIdle >=5 时!
SecondsIdle 归0重新开始