Owner draw combo box

I'm designing an owner draw combo box based on CComboBox.. I've positioned a combo box control in my Resource Editor and set its style to Owner Draw. Now I can receive WM_DRAWITEM messages in OnDrawItem(...)

However, I only seem to receive messages for the drop down part of the combo box (i.e. the list box). Suppose I also want to draw the edit control. Is it possible to receive messages so that the edit control can also be owner drawn?
[459 byte] By [John E] at [2007-11-20 0:11:52]
# 1 Re: Owner draw combo box
I think you could check for hwndItem of the DRAWITEMSTRUCT, if it matches the Edit Box handle and then do your drawing.
MrBeans at 2007-11-10 23:22:25 >
# 2 Re: Owner draw combo box
Thanks for the suggestion but I already tried it and the handle from the DRAWITEMSTRUCT is never the same as the edit ctrl's handle.

In fact, just going back to yesterday, OnDrawItem(...) receives the ID of the control to be redrawn in its first parameter. That ID is always 1000 - which I think we worked out yesterday is the ID for the list control. As far as I can tell, the contents for the edit control are always drawn by CComboBox - even if it's set to be Owner Draw. I feel sure there must be a way around this though...
John E at 2007-11-10 23:23:26 >
# 3 Re: Owner draw combo box
Take a look at this,
http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B82078
Krishnaa at 2007-11-10 23:24:30 >
# 4 Re: Owner draw combo box
Thanks for the link, Krishnaa. I changed the combo box style from CBS_DROPDOWN to CBS_DROPDOWNLIST and I now seem to be back on track again!! :thumb:
John E at 2007-11-10 23:25:32 >