I am trying to do pretty much what is being asked here but due to the complexity of the syntax and shortage of time, I need someone to help me out on this.
I have spent a couple of hours try to get TWO checkboxes shown instead of one but I keep failing. The NSIS syntax is killing me and I can’t seem to get the params to the second USER32::CreateWindowEx right. I want to display the second checkbox below (or to the right) of the first one.
So far I have done the following modifications but this doesn’t seem to create the second checkbox (please see the original post for the rest of the code).
; ---<snip>---
System::Call 'USER32::CreateWindowEx(i0,t "Button",t "Some option",i ${__NSD_CheckBox_STYLE},ir6,ir7,ir8,ir9,ir0,i666,i0,i0)i.r2'
System::Call 'USER32::CreateWindowEx(i0,t "Button",t "Second option",i ${__NSD_CheckBox_STYLE},ir6+100,ir7,ir8,ir9,ir0,i667,i0,i0)i.r3'
SendMessage $0 ${WM_GETFONT} 0 0 $0
SendMessage $2 ${WM_SETFONT} $0 1
SendMessage $3 ${WM_SETFONT} $0 1
${NSD_SetState} $2 1 ;check it
${NSD_SetState} $3 1 ;check it
FunctionEnd
Function licleave
FindWindow $5 "#32770" "" $HWNDPARENT
GetDlgItem $0 $5 666
GetDlgItem $1 $5 667
${NSD_GetState} $0 $0
${NSD_GetState} $1 $1
MessageBox mb_ok "Checkbox=$0 $1"
FunctionEnd
You cannot do math like
ir6+100in a system::call (You can only OR simple numbers), tryIntOp $6 $6 + 100before you create the second checkbox.Edit:
The code from the other answer also gave the checkbox the same width as the dialog so any other control added to the right of it will appear behind it.
You must adjust the size of the first checkbox as well: