Tham khảo tài liệu 'c++ programming for games module ii phần 7', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Yes one of the radio buttons in the group was selected so select the new one stored in LOWORD wParam and deselect the other to update the radio button GUI. Note Assumes the radio buttons were created sequentially. CheckRadioButton hDlg IDC RADIO FIGHTER First radio button in group IDC_RADIO_WIZARD Last radio button in group LOWORD wParam Button to select. Save currently selected radio button. classSelection LOWORD wParam return true Observe that we do not test for each individual radio button selection rather we test for any selection. LOWORD wParam will give us the actual button pressed which we pass on to the CheckRadioButton function which will handle selecting the correct button and deselecting the others. Finally the last key idea of this program is the message box. More specifically when the user presses the OK button we want the program to display a message specific to the character radio button selected. This is easy enough since we have saved the current radio button selected in the classSelection variable. Thus we could do a simple if statement to output an appropriate message based on the selection. However instead we add the following variable to the dialog procedure that contains our messages string classNames 4 You selected the You selected the You selected the You selected the Fighter. Cleric. Thief. Wizard. We then output the message like so case IDOK Now display the class the user selected in a message box. MessageBox 0 classNames classSelection-IDC_RADIO_FIGHTER .c_str Message MB_OK return true The interesting line is classNames classSelection-IDC_RADIO_FIGHTER .c_str The best way to explain this is to look at the actual numeric values of the resource IDs. If you open you may see something similar to the following 193 define IDC_ RADIO _FIGHTER 1001 define IDC_ RADIO _CLERIC 1002 define IDC_ RADIO _THIEF 1003 define IDC RADIO WIZARD 1004 Again the resource identifiers are just unique ways of identifying the resource items. Our array .