// 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);
Win32 ComboBoxEx does not update items
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.
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 ;)
You probably just need to force the combo box window to repaint itself. Try using InvalidateRect on the combo box window handle.
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??
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??
That might as well be a fault of the message pump or the window proc.
Are you per chance passing a non-NULL HWND into PeekMessage/GetMessage?
Are you per chance passing a non-NULL HWND into PeekMessage/GetMessage?
Have you tried this?
UpdateWindow(hWnd);
Works for me :)
...or in your case UpdateWindow(hwndDlg);
UpdateWindow(hWnd);
Works for me :)
...or in your case UpdateWindow(hwndDlg);
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 :(
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 :(
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 :)
DialogBox(hInstance,MAKEINTRESOURCE(IDD_DIALOG1),NULL,MainDlgProc);
I must admit I haven't tried the other way (that you use).
Good luck :)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement