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 网络时间校对

Delphi twebbrowser get html source after ajax load

Delphi检测用户是否具有administrator权限

Delphi 对话框初始地址initialdir

vclzip控件的使用

Delphi 自定义colorbox只显示指定颜色项目 colorbox显示中文颜色名称

Delphi 判断com端口是否存在

Delphi 判断网站文件是否存在

Delphi 编写activex控件(ocx控件)的知识和样例

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



打赏

取消

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

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

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

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

评论

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