unit Unit3;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, System.ComponentModel, Borland.Vcl.StdCtrls,Borland.Vcl.ComCtrls, Borland.Vcl.ExtCtrls,
IdBaseComponent, IdThreadComponent;
type
TForm3 =
class(TForm)
Button1: TButton;
MainProgress: TProgressBar;
IdThreadComponent1: TIdThreadComponent;
Button2: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
procedure MyOnTerminate(Sender:TObject);
public
{ Public declarations }
end;
var
Form3: TForm3;
implementation
uses MyThread;
{$R *.nfm}
//*******************************************************//
procedure TForm3.Button1Click(Sender: TObject);
var
TT : TMyThread;
begin
TT := TMyThread.Create(True);
TT.FreeOnTerminate := True;
TT.OnTerminate := MyOnTerminate;
TT.Resume;
end;
//*******************************************************//
procedure TForm3.MyOnTerminate(Sender: TObject);
begin
ShowMessage('
Done');
end;
//*******************************************************//
end.