inno-setup - 在 Inno Setup 窗口中打开外部程序
问题描述
我有一些 Exe 格式的动画,我需要将它们加载到 Inno Setup 的面板中。
我找到了关于 Delphi 的这些:http:
//www.delphipages.com/forum/archive/index.php/t-200729.html
如何外壳到另一个应用程序并让它以 delphi 形式出现
如何在 Inno Setup 中实现这样的事情?
解决方案
Inno Setup 的等效代码如下:
[Code]
function SetParent(hWndChild: HWND; hWndNewParent: HWND): HWND;
external 'SetParent@User32.dll stdcall';
function ShowWindow(hWnd: HWND; nCmdShow: Integer): BOOL;
external 'ShowWindow@User32.dll stdcall';
procedure InitializeWizard();
var
Page: TWizardPage;
ResultCode: Integer;
ProgHandle: HWND;
begin
Page := CreateCustomPage(wpWelcome, 'Test', '');
Exec('notepad.exe', '', '', SW_HIDE, ewNoWait, ResultCode);
while ProgHandle = 0 do
ProgHandle := FindWindowByWindowName('Untitled - Notepad');
SetParent(ProgHandle, Page.Surface.Handle);
ShowWindow(ProgHandle, SW_SHOWMAXIMIZED);
end;
虽然我建议你不要这样做。这是一个不可靠的黑客。在安装程序本身中通过 Pascal 代码显示图像。
推荐阅读
- python - argrelmin 的顺序:在两边指定不同的顺序
- laravel - 如何使用 JWT 在 Apiato 项目中编写生成令牌的函数?
- ssl - Tomcat 未在 8443 端口启动
- spring-data - 有没有办法在 Spring Data MongoDB 中不使用 @Version 注释来配置版本属性?
- algorithm - N级字符串压缩:解压缩算法
- python - 从另一个数组中的数组中查找不存在的字段
- python - 如何使节点 a 和 f 的颜色不同?
- javascript - Javascript:访问数组中的子对象
- flutter - Flutter Injectable:通过注解注入多个泛型类型实例
- kentico - 编写适用于本地化模块文本的链接