本文整理自网络,侵删。
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 ioutils 单元(6): tpath(结构体)路径的提取和处理
Delphi combobox和listbox的文字可以右对齐显示
更多相关阅读请进入《Delphi》频道 >>