From 53442f4f53833d4649b7c3303ac1c79d6c95e79c Mon Sep 17 00:00:00 2001 From: kichik Date: Tue, 3 Apr 2007 11:19:36 +0000 Subject: [PATCH] applied patch #1682748 - installer icon for message box git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5036 212acab6-be3b-0410-9dea-997c60f758d6 --- Docs/src/flowcontrol.but | 2 ++ Source/exehead/util.c | 23 ++++++++++++++++++++++- Source/script.cpp | 1 + 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/Docs/src/flowcontrol.but b/Docs/src/flowcontrol.but index 5e0ecaf8..86224eb5 100644 --- a/Docs/src/flowcontrol.but +++ b/Docs/src/flowcontrol.but @@ -212,6 +212,8 @@ Displays a MessageBox containing the text "messagebox_text". mb_option_list must \b \e{MB_ICONSTOP} - Display with stop icon +\b \e{MB_USERICON} - Display with installer's icon + \b \e{MB_TOPMOST} - Make messagebox topmost \b \e{MB_SETFOREGROUND} - Set foreground diff --git a/Source/exehead/util.c b/Source/exehead/util.c index edb95d8f..ef8f3056 100644 --- a/Source/exehead/util.c +++ b/Source/exehead/util.c @@ -23,6 +23,7 @@ #include "fileform.h" #include "exec.h" #include "ui.h" +#include "resource.h" #ifdef NSIS_CONFIG_LOG #if !defined(NSIS_CONFIG_LOG_ODS) && !defined(NSIS_CONFIG_LOG_STDOUT) @@ -84,6 +85,19 @@ int NSISCALL my_GetDialogItemText(UINT idx, char *val) int NSISCALL my_MessageBox(const char *text, UINT type) { int _type = type & 0x001FFFFF; + static MSGBOXPARAMS mbp = { + sizeof(MSGBOXPARAMS), + 0, + 0, + 0, + 0, + 0, + MAKEINTRESOURCE(IDI_ICON2), + 0, + 0, + 0 + }; + #ifdef NSIS_CONFIG_SILENT_SUPPORT // default for silent installers if (g_exec_flags.silent && type >> 21) @@ -92,7 +106,14 @@ int NSISCALL my_MessageBox(const char *text, UINT type) { // no silent or no default, just show if (g_exec_flags.rtl) _type ^= MB_RIGHT | MB_RTLREADING; - return MessageBox(g_hwnd, text, g_caption, _type); + + mbp.hwndOwner = g_hwnd; + mbp.hInstance = g_hInstance; + mbp.lpszText = text; + mbp.lpszCaption = g_caption; + mbp.dwStyle = _type; + + return MessageBoxIndirect(&mbp); } void NSISCALL myDelete(char *buf, int flags) diff --git a/Source/script.cpp b/Source/script.cpp index 123b9fac..3a8c0633 100644 --- a/Source/script.cpp +++ b/Source/script.cpp @@ -3776,6 +3776,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line) MBD(MB_ICONINFORMATION) MBD(MB_ICONQUESTION) MBD(MB_ICONSTOP) + MBD(MB_USERICON) MBD(MB_TOPMOST) MBD(MB_SETFOREGROUND) MBD(MB_RIGHT)