Delphi edit control created in Unicode instead of ANSI mode
hallo at michael-kaufmann.ch
Mon Sep 5 04:23:18 CDT 2005
Does Windows XP use Unicode controls too if theming is on?
>>Because the Delphi edit controls are now in Unicode mode, the messages
>>sent to them have to be translated from ANSI to Unicode and back. When a
>>program reads the "Text" property of a TEdit control, Delphi sends a
>>WM_GETTEXTLENGTH message. Wine doubles the return value when translating
>>back from Unicode to ANSI because of double-byte character sets.
>Windows (2k+ at least) in this case actually also sends a Unicode
>WM_GETTEXT in this case and determines the true ANSI length from the
>Unicode string. Wine should (IMO) be fixed to do the same.
I can confirm this. Windows 2000 does not truncate any text or return
doubled text lengths (even if it could according to the MSDN docs). We
need to improve Wine's automatic message translation a lot! Some
examples of A->W message translations:
WM_GETTEXTLENGTH: Windows sends WM_GETTEXTLENGTH and WM_GETTEXT
LB_GETTEXTLEN: LB_GETTEXTLEN, LB_GETTEXT
CB_GETLBTEXTLEN: CB_GETLBTEXTLEN, CB_GETLBTEXT
LB_GETTEXT: LB_GETTEXTLEN, LB_GETTEXT, LB_GETTEXT
CB_GETLBTEXT: CB_GETLBTEXTLEN, CB_GETLBTEXT, CB_GETLBTEXT
>Try this patch:
>Unfortunately, it is as-is not CVS-worthy...
I think you could use SendMessageW instead of calling the window proc
directly. But apart from that, why is the patch not CVS-worthy?
More information about the wine-devel