简体   繁体   English

自定义NSIS MessageBox标题/标题

[英]Customise NSIS MessageBox title / caption

In an NSIS installer, I'm interested in displaying a MessageBox with a custom title. 在NSIS安装程序中,我有兴趣显示带有自定义标题的MessageBox。 I currently have: 我目前有:

MessageBox MB_OK|MB_ICONEXCLAMATION|MB_TOPMOST "%SOME_STRING%"

In this call, there's no definition of MessageBox title, which then becomes a default string, saying <Installer Name> Setup . 在此调用中,没有MessageBox标题的定义,然后该标题变为默认字符串,表示<Installer Name> Setup I would like to remove the 'Setup' part, or provide a string of my own. 我想删除“设置”部分,或提供我自己的字符串。

Thank you. 谢谢。

You can use the Caption attribute to set the caption Caption "Whatever" but that changes it globally. 您可以使用Caption属性设置标题Caption "Whatever"但是全局更改标题。

NSIS does not have native support for a custom MessageBox caption but you can call the Windows API directly: NSIS没有自定义MessageBox标题的本机支持,但您可以直接调用Windows API:

Section
!define MB_OK 0x00000000
!define MB_ICONINFORMATION 0x00000040
System::Call 'USER32::MessageBox(i $hwndparent, t "The message", t "The caption", i ${MB_OK}|${MB_ICONINFORMATION})i'
SectionEnd

You can lookup the other MB_* flags on MSDN ... 您可以在MSDN上查找其他MB_*标志...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM