我写了一个带有扩展性的系统初始化程序,我希望把各个作出功能
编译成单个的dll或bpl,在父窗口中调用显示这些功能,并使其嵌
入到父窗口中,看起来像是一个窗口。请问有办法实现吗?

解决方案 »

  1.   

    把它嵌入到父窗口的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;
      

  2.   

    to wdsimon()非常感谢,我基本明白了。
    请问这个过程有完整例子吗?分给你了。