unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 =
class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private-Deklarationen }
procedure OnFinish(Sender: TObject; Value: Integer);
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
uses
Unit2;
procedure TForm1.Button1Click(Sender: TObject);
var
MyThread: TMyThread;
begin
MyThread := TMyThread.Create(True);
MyThread.FreeOnTerminate := True;
MyThread.OnFinish := OnFinish;
MyThread.Resume;
end;
procedure TForm1.OnFinish(Sender: TObject; Value: Integer);
begin
ShowMessage(IntToStr(Value));
end;
end.