View Full Version: combobox text in dialog

C++ Learning Community > win32 api C++ programming > combobox text in dialog


Title: combobox text in dialog
Description: confused


ih8censorship - November 18, 2006 05:28 AM (GMT)
i have a dialog box that has combo boxes and im wondering how to add things to the comboboxes at runtime. I cant figure out how to use sendmessage to do it because id have to have the hwnd of the combobox right? and i dont know how to get those when dealing with dialog boxes from resource files. any help would be greatly appreciated :)

suiram - December 6, 2006 06:01 PM (GMT)
::SendMessage(hCOmbo,CB_ADDSTRING,0,(LPCTSTR)"string 1");
::SendMessage(hCOmbo,CB_ADDSTRING,0,(LPCTSTR)"string 2");

Other COMBO messages
CB_DELETESTRING
CB_FINDSTRING
CB_GETCURSEL
CB_GETCOUNT

...
From resources into a dialog.
COMBOBOX resource ID is IDC_COMBO

HWND hCombo=::GetDlgItem(hDialog, IDC_COMBO);
//now you have hCombo;




Hosted for free by InvisionFree