unit
Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TFormThread =
class
(TThread)
private
AForm: TForm;
procedure
ShowMessage;
protected
procedure
Execute; override;
end
;
TForm1 =
class
(TForm)
Button1: TButton;
procedure
Button1Click(Sender: TObject);
private
public
end
;
var
Form1: TForm1;
implementation
uses
Unit2, Unit3;
{$R *.dfm}
procedure
TFormThread
.
Execute;
begin
AForm:=Form2;
Synchronize(ShowMessage);
Form3
.
Memo1
.
Text:=Form2
.
Edit1
.
Text;
AForm:=Form3;
Synchronize(ShowMessage);
Windows
.
Beep(
1000
,
100
);
end
;
procedure
TFormThread
.
ShowMessage;
begin
AForm
.
ShowModal;
end
;
procedure
TForm1
.
Button1Click(Sender: TObject);
begin
TFormThread
.
Create(
False
);
end
;
end
.