Problem with custom Combobox and 4.50
Posted: Tue Jul 27, 2010 5:19 pm
I have a piece of code that worked in 4.41, but does no longer work with 4.50.
Way too much code to post, so I just show the piece that no goes wrong.
Have a look at the line with "debug text$".
In 4.41 text$ contained the text of my combobox item.
In 4.50 text$ shows some weird (asian?) characters.
I am compiling with UNICODE option enabled.
What has changed?
P.S.
The drawing of the custom icons still works.
And I can still set the text behind the custom icons if use some static text.
If I disable all the custom drawing, the original text appears correct as well.
Only the reading of the text does no longer worked.
I just crosschecked. Same code, with 4.41, no prolems.
Way too much code to post, so I just show the piece that no goes wrong.
Code: Select all
Case #WM_DRAWITEM
*DrawItem.DRAWITEMSTRUCT = lParam
If *DrawItem\CtlType = #ODT_COMBOBOX
SetBkMode_(*DrawItem\hdc, #TRANSPARENT) ; Text is rendered transparent
If *DrawItem\itemState & #ODS_FOCUS
FillRect_(*DrawItem\hdc, *DrawItem\rcItem, GetSysColorBrush_(#COLOR_HIGHLIGHT))
Else
FillRect_(*DrawItem\hdc, *DrawItem\rcItem, GetSysColorBrush_(#COLOR_MENU) )
EndIf
If *DrawItem\itemID <>-1
text$ = Space(512)
SendMessage_(*DrawItem\hwndItem, #CB_GETLBTEXT, *DrawItem\itemID, @text$)
Debug text$
DrawIconEx_(*DrawItem\hdc, *DrawItem\rcItem\left+2 , *DrawItem\rcItem\top+2, hailang(hailangPos2ID(*DrawItem\itemID))\flag, 50, 11, 0, 0, #DI_NORMAL)
TextOut_ (*DrawItem\hdc, *DrawItem\rcItem\left+2+56, *DrawItem\rcItem\top+1, text$, Len(text$))
EndIf
EndIf
EndSelect In 4.41 text$ contained the text of my combobox item.
In 4.50 text$ shows some weird (asian?) characters.
I am compiling with UNICODE option enabled.
What has changed?
P.S.
The drawing of the custom icons still works.
And I can still set the text behind the custom icons if use some static text.
If I disable all the custom drawing, the original text appears correct as well.
Only the reading of the text does no longer worked.
I just crosschecked. Same code, with 4.41, no prolems.