function TFrm_main.LastInput: DWord; //取系统无操作时间
var
LInput: TLastInputInfo;
begin
LInput.cbSize := SizeOf(TLastInputInfo);
GetLastInputInfo(LInput);
Result := GetTickCount - LInput.dwTime;
end;主窗体timer1控件写:
var
time :word;
beginv
time := self.LastInput;
if time > timer1.Interval then
begin
ShowWindow(Frm_main.Handle,SW_HIDE);
Frm_login.Visible := true;
end;我这里可以实现了,但是在2000下能用,98下不能用 ,因为GetLastInputInfo这个api不能用,请教大家怎么解决,得结果立即给分,在线等.谢谢!
var
LInput: TLastInputInfo;
begin
LInput.cbSize := SizeOf(TLastInputInfo);
GetLastInputInfo(LInput);
Result := GetTickCount - LInput.dwTime;
end;主窗体timer1控件写:
var
time :word;
beginv
time := self.LastInput;
if time > timer1.Interval then
begin
ShowWindow(Frm_main.Handle,SW_HIDE);
Frm_login.Visible := true;
end;我这里可以实现了,但是在2000下能用,98下不能用 ,因为GetLastInputInfo这个api不能用,请教大家怎么解决,得结果立即给分,在线等.谢谢!
用2个TIMER,设置三分钟
然后开始判断鼠标位置(用鼠标位置来判断是否操作,应该可以)TIMER检测鼠标位置跟上一次鼠标位置不一样,则触发你的事件