Ein paar kleine Anpassungen für den Code aus Beitrag #2:
Delphi-Quellcode:
type
TDemoThread = class(TThread)
private
Suspending: Boolean;
protected
procedure Execute; override;
end;
TMyComponent = class(TGraphicControl)
private
FThread: TThread;
public
procedure Start;
procedure Stop;
end;
implementation
procedure TDemoThread.Execute;
begin
while not Terminated do
begin
// ...
Suspended := Suspending;
end;
end;
procedure TMyComponent.Start;
begin
FThread.Suspending := False;
end;
procedure TMyComponent.Stop;
begin
FThread.Suspending := True;
end;
marabu