Win32 API
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 ?
The link below offers great tutorials on tons of windows related programming, including MFC (but not as a focus) Almost every tutorial has downloadable source.
The only drawback is I think the site is geared mainly towards Visual C++. (which is fine with me )
Codeproject.com tutorials
The only drawback is I think the site is geared mainly towards Visual C++. (which is fine with me )
Codeproject.com tutorials
[email=JValentine_13@hotmail.com]contact[/email]
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
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
If that's not the help you're after then you're going to have to explain the problem better than what you have. - joanusdmentia
My Page davepermen.net | My Music on Bandcamp and on Soundcloud
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).
I''m pretty sure, that SendMessage(hWnd,CB_ADDSTRING,0,(LPARAM)Str) is wrong.
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"; switch(Message) { case WM_INITDIALOG: CheckDlgButton(hWnd,IDC_FULL,fullscreen); CheckDlgButton(hWnd,IDC_FPS,showfps); SendMessage(hWnd,CB_ADDSTRING,0,(LPARAM)Str); return TRUE; case WM_COMMAND: switch(LOWORD(wParam)) { case IDOK: fullscreen=(IsDlgButtonChecked(hWnd,IDC_FULL)==BST_CHECKED); showfps=(IsDlgButtonChecked(hWnd,IDC_FPS)==BST_CHECKED); EndDialog(hWnd, IDOK); return TRUE; case IDCANCEL: EndDialog(hWnd, IDCANCEL); return TRUE; } break; } return FALSE;}
I''m pretty sure, that SendMessage(hWnd,CB_ADDSTRING,0,(LPARAM)Str) is wrong.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement