Jump to content
  • Advertisement
Sign in to follow this  
AndiDog

Win32 ComboBoxEx does not update items

This topic is 3838 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 I try to change the image of a comboboxex item (Windows XP Pro), it does not get displayed immediately. I have to move another window over it or call hide/show on the comboboxex window to let it show up correctly.
// For example
COMBOBOXEXITEM item;
memset(&item, 0, sizeof(item));
        item.mask           = CBEIF_OVERLAY | CBEIF_INDENT | CBEIF_IMAGE | CBEIF_TEXT;
        item.iItem          = 0;
        item.pszText        = "some text";
        item.iIndent        = 0;
        item.iOverlay       = 1;
        item.iImage         = 1;
          SendDlgItemMessage(hwndDlg, 10001, CBEM_SETITEM, 0, (LPARAM)&item);
Furthermore, the overlay image is not displayed at all although the image definitely exists in the imagelist. MSDN couldn't help me... Hope you can ;)

Share this post


Link to post
Share on other sites
Advertisement
You probably just need to force the combo box window to repaint itself. Try using InvalidateRect on the combo box window handle.

Share this post


Link to post
Share on other sites
Another funny behavior:

InvalidateRect(GetDlgItem(hwndDlg, 10001), 0, false)
does not affect anything =)

InvalidateRect(GetDlgItem(hwndDlg, 10001), 0, true)
which means erase background, let's the comboboxex go white ^^ but it won't get repainted until I move something over it or show/hide

What is going on there??

Share this post


Link to post
Share on other sites
UpdateWindow(hwndDlg) doesn't work for me.

And it's a dialog created by the DialogBoxParam() function, so Windows handles the message queue...


I think I'm gonna use an owner-drawn combobox, this actually seems like a bug to me :(

Share this post


Link to post
Share on other sites
I use the following to create a dialog box (using a resource file)

DialogBox(hInstance,MAKEINTRESOURCE(IDD_DIALOG1),NULL,MainDlgProc);

I must admit I haven't tried the other way (that you use).

Good luck :)

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!