首页 > 解决方案 > 在 Inno Setup 向导中显示 Delphi Form

问题描述

我在 DLL 中有一个 Delphi 表单,我想在 Inno 设置的向导页面中显示它。我正在关注这个问题的一个例子:

如何将 DLL 中的表单嵌入到 Inno Setup 向导页面中?

我使用这些代码行来导出我的 Delphi 表单:

procedure CreateWizardForm(ParentWnd: HWND);stdcall;
var
  R: TRect;
  Form: TOpenSQLServerForm;// the from i want to show
begin
  Form := TOpenSQLServerForm.Create(nil);
  Form.ParentWindow := ParentWnd;
  Form.BorderStyle := bsNone;
  GetWindowRect(ParentWnd, R);
  Form.BoundsRect := R;
  Form.Show;
end;
 

在图书馆我有:

library LoadServerName;

uses
  Winapi.Windows,System.SysUtils, System.Classes, VCL.Forms,VCl.dialogs,
  OpenSQLServer in 'OpenSQLServer.pas' {OpenSQLServerForm};

{$R *.res}

exports
  CreateWizardForm;

begin
end.

最后,我以这种方式在 Inno Setup 中使用我的 DLL:

procedure CreateWizardForm(ParentWnd:HWND);stdcall;
external 'CreateWizardForm@files:LoadServerName.dll stdcall';

procedure InitializeWizard();
begin
  CustomPage := CreateCustomPage(wpSelectDir, 'Caption', 'Description');
  CreateWizardForm(CustomPage.surface.Handle);
end;

当我运行 Inno Setup 时,我希望在 CustomPage 中看到我的向导表单,但它根本没有显示我的表单。有什么问题?

标签: delphiinno-setuppascal

解决方案


推荐阅读