procedure TForm1.Timer1Timer(Sender: TObject);
var
vLastInputInfo: TLastInputInfo;
begin
vLastInputInfo.cbSize := SizeOf(vLastInputInfo);
GetLastInputInfo(vLastInputInfo);
Caption := Format(
'距离上次输入间隔%d毫秒', [GetTickCount - vLastInputInfo.dwTime]);
end;