Hi guys, I have a few problems with dialog boxes. First of all, I call the SendMessage function to add strings to a combo box and when the dialog box is displayed and I try to select it nothing is displayed!!, I'm not sure why this is I performed the following procedure:
1. Use "CreateDialog" to create the dialog box from a resource.
2. Get the hWnd's for the combo boxes by using GetDlgItem
3. Send the appropriate strings to the combo boxes, using CB_ADDSTRING
4. Show the window and set it as foreground
5. Enter message loop (using GetMessage and IsDialogMessage)
1. Use "CreateDialog" to create the dialog box from a resource.
2. Get the hWnd's for the combo boxes by using GetDlgItem
3. Send the appropriate strings to the combo boxes, using CB_ADDSTRING
4. Show the window and set it as foreground
5. Enter message loop (using GetMessage and IsDialogMessage)
Shouldn't you be doing number 2 and 3 in the WM_INITDIALOG?
Hi,
Check the return from CB_ADDSTRING to make sure that it is working, it should return the string index (0 based). Also, if it is a drop-down combo be sure that the total height is enough to include both the edit portion and the list box.
Check the return from CB_ADDSTRING to make sure that it is working, it should return the string index (0 based). Also, if it is a drop-down combo be sure that the total height is enough to include both the edit portion and the list box.
Shouldn't you be doing number 2 and 3 in the WM_INITDIALOG?
I tried that and for some reason, it still didnt work.