把它嵌入到父窗口的PANEL控件上: function LoadForm(Ahandle:Thandle;Aowner:TComponent;str:string; AParent:TPanel):LongInt;stdcall; var DLLForm:TFormModal; begin APPlication.Handle:=Ahandle; if GetClass(str)<>nil then begin DLLForm:=TFormModalClass(FindClass(str)).Create(Aowner,AParent); try windows.SetParent(DLLForm.Handle,AParent.Handle);//这一句很重要 DLLForm.Show; Result:=LongInt(DLLForm); except DLLForm.Free; end; end; result:=LongInt(DLLForm); end;
function LoadForm(Ahandle:Thandle;Aowner:TComponent;str:string;
AParent:TPanel):LongInt;stdcall;
var
DLLForm:TFormModal;
begin
APPlication.Handle:=Ahandle;
if GetClass(str)<>nil then
begin
DLLForm:=TFormModalClass(FindClass(str)).Create(Aowner,AParent);
try
windows.SetParent(DLLForm.Handle,AParent.Handle);//这一句很重要
DLLForm.Show;
Result:=LongInt(DLLForm);
except
DLLForm.Free;
end;
end;
result:=LongInt(DLLForm);
end;
请问这个过程有完整例子吗?分给你了。