Archive: how 2 select the checkbox...


how 2 select the checkbox...
hi:
i have a question, in a InstallOption Page,there are one button,and one checkbox, what can i do when i press the button,and the checkbox will automatically be selected ?


please help me,
my idear: use "GetDlgItem" and get the handle of the checkbox,and then use "SendMessage" , but i don't know what parameters should be placed at the back of "SendMessage" ?


The following code should what you want (not tested):

Function OnButtonClick
#define BM_SETCHECK 0x00F1
#define BST_UNCHECKED 0x0000
#define BST_CHECKED 0x0001
#define BST_INDETERMINATE 0x0002

GetDlgItem $1 $hwnd dialog_item_id
SendMessage $1 ${BM_SETCHECK} BST_CHECKED 0
FunctionEnd

Remarks:
1. OnButtonClick is the leave function of your custom page
2. The button must have NOTIFY flag
3. hwnd is the hwnd of the page. You cant get it in your custom page creation doing so:
!insertmacro MUI_INSTALLOPTIONS_INITDIALOG "my_custom.ini"
;Get the HWnd set by MUI_INSTALLOPTIONS_INITDIALOG
Pop $hwnd
!insertmacro MUI_INSTALLOPTIONS_SHOW
4. dialog_item_id is 1200 + Field_number_of_radio_button-1


it works,thx!