本文整理自网络,侵删。
procedure TForm1.Timer1Timer(Sender: TObject);
var vLastInputInfo: TLastInputInfo;
begin
vLastInputInfo.cbSize := SizeOf(vLastInputInfo);
GetLastInputInfo(vLastInputInfo);
if GetTickCount - vLastInputInfo.dwTime > 5000 then
begin
timer1.Enabled:= false;
showmessage('超过5秒,用户未动鼠标!');
end;
end;
相关阅读 >>
Delphi andorid应用程序检查wifi有效还是无效
Delphi tpath.combine(); {结合路径}
Delphi 用ini记录combobox的itemindex
Delphi 工程判断内存溢出reportmemoryleaksonshutdown := true;
Delphi spcomm 调试串口解决总是在程序断开的时候才发送指令的问题
更多相关阅读请进入《Delphi》频道 >>