中国开发网: 论坛: 程序员情感CBD: 贴子 477252
王中王: 起点在这,再根据你的情况分析一下吧:
在DoActionIdle方法里。
idle的时候会自动遍历所有visible并且enanble的action做update,一般来说CPU占用不会太高。除非update时做了占CPU的操作。
你说的没焦点时CPU占用不高,会不会是没焦点时检查action的条件没有达到?或是action的update操作中对有无焦点做了不同处理?
procedure TApplication.Idle(const Msg: TMsg);
var
Control: TControl;
Done: Boolean;
begin
Control := DoMouseIdle;
if FShowHint and (FMouseControl = nil) then
CancelHint;
Application.Hint := GetLongHint(GetHint(Control));
Done := True;
try
if Assigned(FOnIdle) then FOnIdle(Self, Done);
if Done then DoActionIdle;
except
HandleException(Self);
end;
if (GetCurrentThreadID = MainThreadID) and CheckSynchronize then
Done := False;
if Done then WaitMessage;
end;
http://wangzw.wordpress.com/
个性化台历、日历制作
http://shop33697570.taobao.com/

相关信息:


欢迎光临本社区,您还没有登录,不能发贴子。请在 这里登录