Initializing Combo Box
Hi and thanks for reading this.
I want to initialize a combo box.When I create the dialog, in which the box will be, I send CB_ADDSTRING to the box, but it doesn't works
Here is the code:
SendDlgItemMessage(theWnd,IDC_COMBO1,CB_ADDSTRING, 0,(LPARAM) "some text");
If you can, please tell me why
Try sending the CB_ADDSTRING message within a WM_INITDIALOG message handler.
I believe you should do the following...
HWND hCB = GetDlgItem(hDlg, IDC_COMBO1); // Get HWND of Combo Box, hDlg is handle sent to DLGPROC
SendMessage(hCB, CB_ADDSTRING, 0, (LPARAM)"Some Text");