unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) procedure FormCreate(Sender: TObject); private { Private declarations } public { Public declarations } end;var Form1: TForm1;implementation{$R *.dfm}procedure TForm1.FormCreate(Sender: TObject); var btn:TButton; begin btn:=TButton.Create(application); btn.Parent:=form1; btn.Caption :='aaa' end;end.
你是说加到EXE文件中? 不会,太高深了.
修改EXE?这要MASM才好办,Delphi不适合做这个的
晕..个个都答错..楼主是想修改exe文件啊....
var ahandle:thandle; btn:tbutton; begin //首先用取得窗口的handle:ahandle; //然后如上楼的写的一样。创建一个按钮; btn:=TButton.Create(application); //再设置parent; btn.Parent:=ahandle;应该是可以。 但是这样的情况是,只有在打开本软件的状态下才起作用。
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.FormCreate(Sender: TObject);
var btn:TButton;
begin
btn:=TButton.Create(application);
btn.Parent:=form1;
btn.Caption :='aaa'
end;end.
>>>>
应该是另一个可执行文件吧
不会楼下的,继续
Bt := Tbutton.Create(self);
Bt :=self;
如果是另外的程序 只有帮你顶
BV.parent=self;
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.FormCreate(Sender: TObject);
var btn:TButton;
begin
btn:=TButton.Create(application);
btn.Parent:=form1;
btn.Caption :='aaa'
end;end.
不会,太高深了.
ahandle:thandle;
btn:tbutton;
begin
//首先用取得窗口的handle:ahandle;
//然后如上楼的写的一样。创建一个按钮;
btn:=TButton.Create(application);
//再设置parent;
btn.Parent:=ahandle;应该是可以。
但是这样的情况是,只有在打开本软件的状态下才起作用。