• Advertisement
Sign in to follow this  

combo box win32

This topic is 4245 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

q)if i create a combo box like so and want to add items to it and select, is there a simple way hEdit = CreateWindowEx(WS_EX_CLIENTEDGE, "COMBOBOX", "weqw", WS_CHILD | WS_VISIBLE |WS_BORDER |CBS_DROPDOWN , 0, 0, 100, 100, hwnd, (HMENU) GetModuleHandle(NULL), NULL); hfDefault = GetStockObject(DEFAULT_GUI_FONT); SendMessage(hEdit, WM_SETFONT, (WPARAM)hfDefault, MAKELPARAM(FALSE, 0)); I find the most awful examples on microsoft for such basic things. Win32 stuff is hard to find for vc++ without a resource editor. I haven't got a resource editor so again , a lot of examples are no good. q) can the combo box be places on top of a graphic loaded and work as normal?

Share this post


Link to post
Share on other sites
Advertisement
Use CB_ADDSTRING to add an item and CB_SETCURSEL to select it:

SendMessage( hEdit, CB_ADDSTRING, 0, (LPARAM)"Hello" );


SendMessage( hEdit, CB_SETCURSEL, iItemToSelect, 0 );



For the combo on top question:

Depends on how you do the graphic. If you use a static to display the bitmap it will work without troubles, you just have to create the combo AFTER you create that static.

I'm not sure it'll work without problems if you display the bitmap in WM_ERASEBKGND or WM_PAINT. You may have to exclude the combo rect from the update rect.

Share this post


Link to post
Share on other sites
ok thanks for that.

what about the button , can you detect when a button has been pressed without going through the WM_COMMAND eg using a sendMessage

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement