F
fuckjava
Unregistered / Unconfirmed
GUEST, unregistred user!
library Project1;
uses
SysUtils, Controls, Stdctrls, Extctrls, Windows, Graphics, Classes, Forms;
{$R *.res}
function CreateControl(AParent : TWinControl; AOwner : TComponent) : THandle; stdcall; export;
var
c : TPanel;
begin
c := TPanel.Create(AOwner);
c.Parent := AParent;
c.SetBounds(10, 10, 300, 200);
c.Visible := true;
Result := 1;
end;
exports
CreateControl;
begin
end.
//调用程序
var
ret : Integer;
function CreateControl(AParent : TWinControl; AOwner : TComponent) : THandle; stdcall; external 'project1.dll';
procedure TForm1.Button1Click(Sender: TObject);
begin
c := CreateControl(panel1, panel1);
end;
调用成功,为什么显示不出来?非得要 ShowWindow 函数,但用了这个函数后,程序里就乱了,应该失去焦点的不失去!
uses
SysUtils, Controls, Stdctrls, Extctrls, Windows, Graphics, Classes, Forms;
{$R *.res}
function CreateControl(AParent : TWinControl; AOwner : TComponent) : THandle; stdcall; export;
var
c : TPanel;
begin
c := TPanel.Create(AOwner);
c.Parent := AParent;
c.SetBounds(10, 10, 300, 200);
c.Visible := true;
Result := 1;
end;
exports
CreateControl;
begin
end.
//调用程序
var
ret : Integer;
function CreateControl(AParent : TWinControl; AOwner : TComponent) : THandle; stdcall; external 'project1.dll';
procedure TForm1.Button1Click(Sender: TObject);
begin
c := CreateControl(panel1, panel1);
end;
调用成功,为什么显示不出来?非得要 ShowWindow 函数,但用了这个函数后,程序里就乱了,应该失去焦点的不失去!