Skip to content
⌘ NSIS Forum Archive

Customisable-MsgBox doesn't return -1 with no selection

1 posts

l_d_allan#

Customisable-MsgBox doesn't return -1 with no selection

I was trying out the Customisable MessageBox v0.98 beta-3 and noticed behavior that doesn't seem to conform to the documentation.

My understanding is that if no selection is made, then $0 will be set to -1. The code below ends up with $0 being 3 if the ESC button is pressed, or the MessageBox window is closed with the upper right X.

Am I doing something wrong, or leaving something out?

Name "Customisable Messagebox plug-in test"

OutFile "Example.exe"
ShowInstDetails show

Section
# show four buttons
messagebox::show MB_DEFBUTTON1 "Test 1" \
"0,103" \
"Text that will show up" \
IDYES IDNO "Maybe" "Who Cares"

Pop $0
# Put $0 in $R1 just in case something changes $0
# Earlier testing used $0 with same results
StrCpy $R1 $0
DetailPrint "messagebox call 1 returned... $0"

StrCmp $R1 1 0 +3
DetailPrint "Yes selected"
Goto done
StrCmp $R1 2 0 +3
DetailPrint "No selected"
Goto done
StrCmp $R1 3 0 +3
DetailPrint "Maybe selected"
Goto done
StrCmp $R1 4 0 done
DetailPrint "Who Cares selected"
Goto done

done:
SectionEnd