type TMyThread = class(TThread) private { Private declarations } protected procedure Execute; override; end; implementation { TMyThread } procedure TMyThread.Execute; begin { Place thread code here } end; end.
var SecondProcess: TMyThread; { TMyThread is a custom descendant of TThread } begin SecondProcess := TMyThread.Create(True); { create suspended ?secondprocess does not run yet } SecondProcess.Priority := tpLower; { set the priority to lower than normal } SecondProcess.Resume; { now run the thread } end; (代理服务器有问题,不能发长的留言,请原谅) -------------------------------------- 看! 那支正飞向太阳的蛾子..... 就是我! --------------------------------------
var SecondProcess: TMyThread; { TMyThread is a custom descendant of TThread } begin SecondProcess := TMyThread.Create(True); { create suspended ?secondprocess does not run yet } SecondProcess.Priority := tpLower; { set the priority to lower than normal } SecondProcess.Resume; { now run the thread } end;
FormWait.Show;
FormWait.Update;
你的操作....
FormWait.Hide;
FormWait.Free;为了效果更好,你还可以这样做:
1、使用SetWindowPos将提示窗口放在最前面
2、设置Screen的光标为等待状态
3、暂时禁用父窗口,操作完成后再恢复
TMyThread = class(TThread)
private
{ Private declarations }
protected
procedure Execute; override;
end;
implementation
{ TMyThread }
procedure TMyThread.Execute;
begin
{ Place thread code here }
end;
end.
begin
SecondProcess := TMyThread.Create(True); { create suspended ?secondprocess does not run yet }
SecondProcess.Priority := tpLower; { set the priority to lower than normal }
SecondProcess.Resume; { now run the thread }
end;
(代理服务器有问题,不能发长的留言,请原谅)
--------------------------------------
看!
那支正飞向太阳的蛾子.....
就是我!
--------------------------------------
begin
SecondProcess := TMyThread.Create(True); { create suspended ?secondprocess does not run yet }
SecondProcess.Priority := tpLower; { set the priority to lower than normal }
SecondProcess.Resume; { now run the thread }
end;