Okaay.. See my code.. This is for creating those RadioButtons.. This is working perfectly well..
Now, the message handling code.. where Im having the actual problem.. See I need to choose only one radio button at a time and process that RadioButton while pressing a PUSHBUTTON to get the RadioButton's name.Code:#define ID_RADIO1 1034 #define ID_RADIO2 1035 #define ID_RADIO3 1036 #define ID_RADIO4 1037 #define ID_RADIO5 1038 #define ID_RADIO6 1039 int i=0; HWND hRadio [10]; //Maximum 10 RadioButtons while (some condition) { hRadio[i] = CreateWindowEx(0, L"BUTTON", 0, WS_VISIBLE | WS_CHILD | BS_AUTORADIOBUTTON, 26, hi, 140, 20, hReIP, (HMENU)1034+i, hIns, 0); SetWindowText(hRadio[i], lpHold); SendMessage(hRadio[i], WM_SETFONT, (WPARAM)hFont, 0); hi+=18; i++; }
But this is handling just 1st radio button which in fact working but if i process same way IDB_RADIO2 and so on it's not working for those buttons. and I need to process radiobutton with a pushbutton.Code:case WM_COMMAND: { switch(LOWORD(wParam)) { case ID_RADIO1: if ( HIWORD(wParam) == BN_CLICKED) { WCHAR text[100]; SendMessage((HWND)hRadio, WM_GETTEXT, 100, (LPARAM)text); MessageBox(0,text,0,0); } break; } }




Reply With Quote