From d0ae8797781c8a2b67c87ac771e3b91f67ac18ce Mon Sep 17 00:00:00 2001 From: kichik Date: Sat, 22 Mar 2003 15:31:21 +0000 Subject: [PATCH] Updates git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2352 212acab6-be3b-0410-9dea-997c60f758d6 --- Contrib/System/System.nsh | 2 ++ Contrib/System/System.nsi | 11 +++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Contrib/System/System.nsh b/Contrib/System/System.nsh index 13c193a6..6a06e370 100644 --- a/Contrib/System/System.nsh +++ b/Contrib/System/System.nsh @@ -19,6 +19,8 @@ !define sysMessageBox "user32::MessageBoxA(i, t, t, i) i" +!define sysMessageBeep "user32::MessageBeep(i) i" + !define sysMessageBoxIndirect 'user32::MessageBoxIndirectA(i) i' ; HMODULE GetModuleHandle(LPCTSTR lpModuleName); diff --git a/Contrib/System/System.nsi b/Contrib/System/System.nsi index a638d002..52c4834a 100644 --- a/Contrib/System/System.nsi +++ b/Contrib/System/System.nsi @@ -14,6 +14,8 @@ Section "ThisNameIsIgnoredSoWhyBother?" ; ----- Sample 1 ----- Message box with custom icon ----- + ; there are no default beeps for custom message boxes, use sysMessageBeep + ; in case you need it (see next message box example) !insertmacro smMessageBox "i 0" "Message box with custom icon!" "System Example 1a" ${MB_OK} "i 103" ; i 0 - installer exe as module ; i 103 - icon ID @@ -22,7 +24,8 @@ Section "ThisNameIsIgnoredSoWhyBother?" ; You could use this dll for storing your resources, just replace FAR icon ; with something you really need. File "${NSISDIR}\Contrib\System\Resource.dll" - !insertmacro smMessageBox "`$TEMP\resource.dll`" "Message box with custom icon from resource.dll!" "System Example 1b" ${MB_OK} "i 103" + System::Call '${sysMessageBeep} (${MB_ICONHAND})' ; custom beep + !insertmacro smMessageBox "`$TEMP\resource.dll`" "Message box with custom icon from resource.dll!" "System Example 1b" ${MB_OKCANCEL} "i 103" Delete $TEMP\resource.dll ; ----- Sample 2 ----- Fixed disks size/space ----- @@ -65,12 +68,12 @@ enumex: ; End of drives or user cancel System::Free $1 ; Message box - System::Call '${sysMessageBox}($HWNDPARENT, s, "System Example 2", 33)' "$7" + System::Call '${sysMessageBox}($HWNDPARENT, s, "System Example 2", ${MB_OKCANCEL})' "$7" ; ----- Sample 3 ----- Direct proc defenition ----- ; Direct specification demo - System::Call 'user32::MessageBoxA(i $HWNDPARENT, t "Just direct MessageBoxA specification demo ;)", t "System Example 3", i 33) i.s' + System::Call 'user32::MessageBoxA(i $HWNDPARENT, t "Just direct MessageBoxA specification demo ;)", t "System Example 3", i ${MB_OK}) i.s' Pop $0 ; ----- Sample 4 ----- Int64, mixed definition demo ----- @@ -83,7 +86,7 @@ enumex: ; End of drives or user cancel ; Cdecl demo (uses 3 defenitions (simple example)) System::Call "${syswsprintf}(.R1, s,,, t, ir0) .R0 (,,tr2,tr3,$4_)" "Int64 ops and strange defenition demo, %s x %s == %s, and previous msgbox result = %d" - MessageBox MB_OK "Cool: '$R1'" + MessageBox MB_OKCANCEL "Cool: '$R1'" ; ----- Sample 5 ----- Small structure example -----