本文整理自网络,侵删。
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 twebbrowser get html source after ajax load
Delphi 自定义colorbox只显示指定颜色项目 colorbox显示中文颜色名称
Delphi 编写activex控件(ocx控件)的知识和样例
更多相关阅读请进入《Delphi》频道 >>