
2 very non-opengl questions
I''m building this project in OWL using C++ 5.02. I want to add a dockable toolbar to my program and make a ComboBox appear on it. So far everything''s cool, but I don''t know how to add strings to the ComboBox. I mean, I know how to do it, but a simple ComboBox->AddString("string") isn''t enough (the strings do not appear). As I understand it the user has to press something and as a result the ComboBox can be filled in. In my program, the Toolbar as well as the ComboBox are members of the application, not the window, so there''s no possible way to do that. How should I go about it?
And yet another question: how do I access windows native controls'' (button, listbox, radiobutton, etc) graphical interfaces or at the very least how do I access the window''s non-client area?
Since everyone seems to have a saying, here''s mine:
"It''s the butler... It''s always the butler." -
Thanx in advance!

I don''t know too much about OWL, and I''m not at home where I have a version of Borland C++ builder.
As for your other question, I know that you can create windows that use the windows native controls. To do this, when you call create window, you can specify one of the following preset strings:
BUTTON
COMBOBOX
EDIT
LISTBOX
MDICLIENT
RichEdit
RICHEDIT_CLASS
SCROLLBAR
STATIC
I''m not sure, but if you do that, then you might be able to override the default windows drawing routines if you wanted to.
As for accessing the non-client area (for drawing I''d assume), you can call GetDCEx(), using the flag DCX_WINDOW, to get the DC for the entire window not just the client area.
J.W.
As for your other question, I know that you can create windows that use the windows native controls. To do this, when you call create window, you can specify one of the following preset strings:
BUTTON
COMBOBOX
EDIT
LISTBOX
MDICLIENT
RichEdit
RICHEDIT_CLASS
SCROLLBAR
STATIC
I''m not sure, but if you do that, then you might be able to override the default windows drawing routines if you wanted to.
As for accessing the non-client area (for drawing I''d assume), you can call GetDCEx(), using the flag DCX_WINDOW, to get the DC for the entire window not just the client area.
J.W.
Don''t know about OWL but in win32 API just use SendMessage to do stuff with any windows control. For comboboxes the messages are prefixed CB_ and the one to add a string is - CB_ADDSTRING.
eg
TCHAR chTxt[]=TEXT("String to add"));
SendMessage(hCombo,CB_ADDSTRING,0,(LPARAM)chTxt);
where hCombo is the handle of your combobox.
To access the non-client area of a window there are a bunch of messages prefixed WM_NC****. For painting there''s WM_NCPAINT, for hit-testing (mouse-clicks etc) there''s WM_NCHITTEST, for creation there''s WM_NCCREATE etc. All you need do is set up appropriate handlers for those you need.
Hope that helps. Good luck.
eg
TCHAR chTxt[]=TEXT("String to add"));
SendMessage(hCombo,CB_ADDSTRING,0,(LPARAM)chTxt);
where hCombo is the handle of your combobox.
To access the non-client area of a window there are a bunch of messages prefixed WM_NC****. For painting there''s WM_NCPAINT, for hit-testing (mouse-clicks etc) there''s WM_NCHITTEST, for creation there''s WM_NCCREATE etc. All you need do is set up appropriate handlers for those you need.
Hope that helps. Good luck.
Country: Scotland [not listed in the ''Country'' combobox].
I have a question sort of related to that:
How can you scroll the text in a text box to the bottom? I can keep adding text, but the window doesn't scroll with it.
Edited by - smart_idiot on October 1, 2001 12:35:10 PM
Chess is played by three people. Two people play the game; the third provides moral support for the pawns. The object of the game is to kill your opponent by flinging captured pieces at his head. Since the only piece that can be killed is a pawn, the two armies agree to meet in a pawn-infested area (or even a pawn shop) and kill as many pawns as possible in the crossfire. If the game goes on for an hour, one player may legally attempt to gouge out the other player's eyes with his King.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement