B
bcahz
Unregistered / Unconfirmed
GUEST, unregistred user!
unit UFORmclass;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls,unit2, ExtCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
Timer1: TTimer;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
myfirstform:array[1..100] of tmyform;
temphw:hwnd;
mfreeit:array [1..100] of boolean;
museit:array [1..100] of boolean;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
var
i:integer;
begin
for i:=0 to 100 do
begin
if museit=false then
begin
myfirstform:= tmyform.Create(self);
mfreeit:=false;
museit:=true;
myfirstform.frm.tag:=i;
myfirstform.show;
break;
end;
// temphw:=findwindow('tform','aa');
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
// myfirstform.free;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
var
i,j:integer;
begin
for i:=0 to 100 do
begin
if mfreeit=true then
begin
myfirstform.free;
mfreeit:=false;
museit:=false;
end;
end;
end;
end.
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
tmyform = class(TComponent)
frm :tform;
firstbutton:tbutton;
// tag:string;
constructor Create(AOwner:TComponent); override;
destructor Destroy; override;
// destructor frmDestroy;
procedure show;
// procedure frmclose(Sender: TObject; var Action: TCloseAction);
procedure myclick(sender:tobject);
// procedure myclick();
// procedure formclose(Sender: TObject; var Action: TCloseAction);
end;
implementation
uses
uformclass;
{ tmyform }
{procedure tmyform.frmclose(Sender: TObject; var Action: TCloseAction);
begin
// tmyform.free;
end;}
destructor tmyform.Destroy;
begin
firstbutton.Free;
frm.free;
frm:=nil;
inherited Destroy;
end;
procedure tmyform.myclick(sender:tobject);
begin
showmessage('ok');
mfreeit[frm.Tag]:=true;
//sendmessage(temphw,wm_close,0,0);
end;
constructor tmyform.Create(AOwner:TComponent);
begin
inherited Create(AOwner);
frm:=TForm.Create(APPLICATION);
// frm.parent:=frm;
frm.AutoScroll:=false;
// frm.caption:='aa';
// frm.name:='bb';
// frm.Hide;
// frm.onclose:=frmclose;
firstbutton := tbutton.create(FRM);
firstbutton.parent := frm;
firstbutton.onclick:=myclick;
firstbutton.Left := 23;
firstbutton.Top := 90;
frm.tag:=0;
end;
procedure tmyform.show;
begin
// frm.ShowModal;
frm.Show;
end;
{destructor tmyform.frmDestroy();
begin
tmyform.free;
end;}
{procedure tmyform.formclose(Sender: TObject; var Action: TCloseAction);
begin
action:=cafree;
end;}
end.
***************************
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls,unit2, ExtCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
Timer1: TTimer;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
myfirstform:array[1..100] of tmyform;
temphw:hwnd;
mfreeit:array [1..100] of boolean;
museit:array [1..100] of boolean;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
var
i:integer;
begin
for i:=0 to 100 do
begin
if museit=false then
begin
myfirstform:= tmyform.Create(self);
mfreeit:=false;
museit:=true;
myfirstform.frm.tag:=i;
myfirstform.show;
break;
end;
// temphw:=findwindow('tform','aa');
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
// myfirstform.free;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
var
i,j:integer;
begin
for i:=0 to 100 do
begin
if mfreeit=true then
begin
myfirstform.free;
mfreeit:=false;
museit:=false;
end;
end;
end;
end.
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
tmyform = class(TComponent)
frm :tform;
firstbutton:tbutton;
// tag:string;
constructor Create(AOwner:TComponent); override;
destructor Destroy; override;
// destructor frmDestroy;
procedure show;
// procedure frmclose(Sender: TObject; var Action: TCloseAction);
procedure myclick(sender:tobject);
// procedure myclick();
// procedure formclose(Sender: TObject; var Action: TCloseAction);
end;
implementation
uses
uformclass;
{ tmyform }
{procedure tmyform.frmclose(Sender: TObject; var Action: TCloseAction);
begin
// tmyform.free;
end;}
destructor tmyform.Destroy;
begin
firstbutton.Free;
frm.free;
frm:=nil;
inherited Destroy;
end;
procedure tmyform.myclick(sender:tobject);
begin
showmessage('ok');
mfreeit[frm.Tag]:=true;
//sendmessage(temphw,wm_close,0,0);
end;
constructor tmyform.Create(AOwner:TComponent);
begin
inherited Create(AOwner);
frm:=TForm.Create(APPLICATION);
// frm.parent:=frm;
frm.AutoScroll:=false;
// frm.caption:='aa';
// frm.name:='bb';
// frm.Hide;
// frm.onclose:=frmclose;
firstbutton := tbutton.create(FRM);
firstbutton.parent := frm;
firstbutton.onclick:=myclick;
firstbutton.Left := 23;
firstbutton.Top := 90;
frm.tag:=0;
end;
procedure tmyform.show;
begin
// frm.ShowModal;
frm.Show;
end;
{destructor tmyform.frmDestroy();
begin
tmyform.free;
end;}
{procedure tmyform.formclose(Sender: TObject; var Action: TCloseAction);
begin
action:=cafree;
end;}
end.
***************************