procedure TForm1.FormCreate(Sender: TObject); begin Application.OnIdle := AppIdle; end;//============================================================================== //Application.空闲处理********************************************************** //============================================================================== procedure TForm1.AppIdle(Sender: TObject; var Done: Boolean); begin 在这里可以处理,此事件就是程序空闲的事件 end;
yeeyee(灌水低手) 有具体示范代码吗
function LastInput: DWord; var LInput: TLastInputInfo; begin LInput.cbSize := SizeOf(TLastInputInfo); GetLastInputInfo(LInput); Result := GetTickCount - LInput.dwTime; end;procedure TForm1.Timer1Timer(Sender: TObject); begin Label1.Caption := Format('System Idle since %d ms', [LastInput]); end;
begin
Application.OnIdle := AppIdle;
end;//==============================================================================
//Application.空闲处理**********************************************************
//==============================================================================
procedure TForm1.AppIdle(Sender: TObject; var Done: Boolean);
begin
在这里可以处理,此事件就是程序空闲的事件
end;
有具体示范代码吗
var
LInput: TLastInputInfo;
begin
LInput.cbSize := SizeOf(TLastInputInfo);
GetLastInputInfo(LInput);
Result := GetTickCount - LInput.dwTime;
end;procedure TForm1.Timer1Timer(Sender: TObject);
begin
Label1.Caption := Format('System Idle since %d ms', [LastInput]);
end;