如题,这个HWND是通过参数传过来的。
另外,还要保证这个新建Child窗口在它父窗口(HWnd窗口)上面。

解决方案 »

  1.   

    SetParent(MainForm.Handle, ParentWnd) ==> 0
    失败,怎么办?
      

  2.   

    其实我是要在InstallShield中显示Delphi做的DLL中的窗口:
    function LicenceCheck(ParentWnd: HWnd): Boolean; StdCall;
    var
      MainForm: TFormMain;
    begin
      MainForm := TFormMain.Create(nil);
      if SetParent(MainForm.Handle, ParentWnd) = 0 then
      begin
        Result := False;
        Exit;
      end;
      Result := MainForm.ShowModal = mrOK;
      MainForm.Free;
      MainForm := nil;
    end;InstallShield 6.22 脚本:
        bzPassed = FALSE;
        dllName = SUPPORTDIR^"licencecheckdll.dll";
        if UseDLL(dllName)=0 then
          bzPassed = LicenceCheck(GetWindowHandle(HWND_INSTALL));
        endif;  
        UnUseDLL(dllName);  我的目的是InstallShield调用DLL中这个函数后.窗口能显示在最上面,而现在跑下面去了。
    现在的问题是:
    Parent是设置成功了,但窗口显示不出来
      

  3.   

    application.CreateForm(tform2,form2);
    self.FormStyle:=fsMDIForm;
    form2.ParentWindow:=self.Handle;
    form2.Show;