我需要MsgBox
在运行时更改消息框的默认标题.目前它不断地将SetupAppTitle
指令的值显示为标题:
[Setup]
SetupAppTitle=myAppName
Run Code Online (Sandbox Code Playgroud)
但这是在编译时指定的.如何在运行时执行此操作,例如从一个[Code]
部分?
我不认为更改应用程序标题(如果可能)仅对显示对话框标题是一个好主意.所以我会使用MessageBox
甚至被使用的Windows MsgBox
.以下是Inno Setup的Ansi/Unicode版本的简单示例:
[Code]
const
MB_ICONERROR = $10;
MB_ICONQUESTION = $20;
MB_ICONWARNING = $30;
MB_ICONINFORMATION = $40;
#ifdef UNICODE
#define AW "W"
#else
#define AW "A"
#endif
function MessageBox(hWnd: HWND; lpText, lpCaption: string;
uType: UINT): Integer; external 'MessageBox{#AW}@user32.dll stdcall';
procedure ButtonOnClick(Sender: TObject);
begin
MessageBox(0, 'Message Text', 'Message Caption', MB_OK or MB_ICONINFORMATION);
end;
Run Code Online (Sandbox Code Playgroud)