当前位置: 代码迷 >> Windows2000 >> Windows中的长时间无操作有关问题
  详细解决方案

Windows中的长时间无操作有关问题

热度:4348   发布时间:2013-02-26 00:00:00.0
Windows中的长时间无操作问题
Windows中的长时间无操作问题,我想知道我的程序怎么判断当前某段时间内用户无操作
就像QQ一样,长时间没操作后就提示"离开"状态
不知道这是怎么实现的
高人指点..

------解决方案--------------------------------------------------------
GetLastInputInfo是Windows中获取键盘和鼠标空闲时间的API

我只会delphi
Delphi(Pascal) code
function SecondsIdle: DWord;var   liInfo: TLastInputInfo;begin   liInfo.cbSize := SizeOf(TLastInputInfo) ;   GetLastInputInfo(liInfo) ;   Result := (GetTickCount - liInfo.dwTime) DIV 1000;end;
  相关解决方案