Delphi 检测用户超过多长时间没有操作键盘或鼠标


本文整理自网络,侵删。

 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 动态加载删除字体

Delphi中formatdatetime的用法

Delphi andorid应用程序检查wifi有效还是无效

Delphi tpath.combine(); {结合路径}

Delphi 收集了比较全的字符串进制转换

Delphi 用ini记录combobox的itemindex

Delphi 禁止关机的代码

Delphi 工程判断内存溢出reportmemoryleaksonshutdown := true;

Delphi spcomm 调试串口解决总是在程序断开的时候才发送指令的问题

Delphi键盘按键伪码多类型

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...