This topic is now archived and is closed to further replies.

Win32 API

This topic is 6163 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

When my OpenGL program starts, I display dialog box. I operate with checkboxes using IsDlgButtonChecked and CheckDlgButton. But I don''t know how to operate with ComboBoxes (add strings, set selection, retrieve selection). One more question: I write some strings in ComboBox Proprties -> Data Tab. But they don''t appear in the list, is that wrong ? P.S. I understand NeHe''s tutors and OpenGL basics, but I lack Win32 API knowledge. Where can I find some good tutorials on this subject ?

Share this post

Link to post
Share on other sites
how is your combobox created? in the dialog editor of visual c++?

if it is, and it appears when clicking on the arrow like that:

then you have to do one thing in the resource editor:
click onto the arrow of the combo to get it looking like that

then scale it a little (not important how much):

i never found dis discribed anywhere, and it took me bout 3 days to find it out (i always rewrote the sendmessageparts..)

hope it helps, else it helps to others perhaps..

we wanna play, not watch the pictures

Share this post

Link to post
Share on other sites
Thanx to devepermen. I changed the size of dropdown.
And now I think, that Data Tab works only in MFC.

But one question still remains:

How can I add strings, get/set selection
(my dialog''s style is Drop List).

BOOL CALLBACK SetupDlgProc(HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam)
{ char* Str="A String To Be Added";
return TRUE;
{ case IDOK:
EndDialog(hWnd, IDOK);
return TRUE;
EndDialog(hWnd, IDCANCEL);
return TRUE;
return FALSE;

I''m pretty sure, that SendMessage(hWnd,CB_ADDSTRING,0,(LPARAM)Str) is wrong.

Share this post

Link to post
Share on other sites