cvega:Checkbox and Radiobutton are all types of "button" class.For checkbox, add "button" window with style BS_CHECKBOX or BS_AUTOCHECKBOX.For radiobutton, add "button" window with style BS_RADIOBUTTON or BS_AUTORADIOBUTTON.Cheers,-chris
.386....datacaption db "Information",0 yes_message db "You chose yes!",0 no_message db "You chose no!",0....codestart:....elseif uMsg==WM_COMMAND .if wParam==IDC_BUTTON_MAIN_OK .if wParam==IDC_RADIO_YES push 0 push offset caption push offset yes_message push hWin call MessageBox .elseif wParam==IDC_RADIO_NO push 0 push offset caption push offset no_message push hWin call MessageBox .endif ... .endif...end start
.386....datacaption db "Information",0yes_message db "You chose yes!",0no_message db "You chose no!",0final_message db 128 dup(0)....codestart:....elseif uMsg==WM_COMMAND .if wParam==IDC_BUTTON_MAIN_OK push 0 push offset caption push offset final_message push hWin call MessageBox .elseif wParam==IDC_RADIO_YES push offset yes_message push offset final_message call lstrcpy .elseif wParam==IDC_RADIO_NO push offset no_message push offset final_message call lstrcpy ... .endif...end start
Hi,I tried to send the BM_CHECK message whenever a checkbox is checked or unchecked. Is the method I'm doing correct? Anyways I searched MSDN for the SendMessage function and...lResult = SendMessage( // returns LRESULT in lResult (HWND) hWndControl, // handle to destination control (UINT) BM_GETCHECK, // message ID (WPARAM) wParam, // = 0; not used, must be zero (LPARAM) lParam // = 0; not used, must be zero);...which in MASM32 I believe is invoke SendMessage, hWin, BM_GETCHECK, 0, 0 -- where can I find the lResult/Return value? In eax?Also, the return value will be either BST_CHECKED or BST_UNCHECKED according to the doc, is it literally "BST_CHECKED" and "BST_UNCHECKED"?Thank you!
Yes, the result will be in EAX..IF eax == BST_CHECKED ; do something.ENDIFCheers,-chris
Hmmm... yeah, I did this already, but the problem is that whether it is ticked or not, it always returns BST_UNCHECKED... here's the current code on that part...
Thanks!