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
This commit is contained in:
kichik 2007-04-03 11:19:36 +00:00
parent 3ebe1d6d61
commit 53442f4f53
3 changed files with 25 additions and 1 deletions

View file

@ -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

View file

@ -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)

View file

@ -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)