Delphi edit control created in Unicode instead of ANSI mode

Frank Richter frank.richter at
Sun Sep 4 14:20:02 CDT 2005

On 04.09.2005 16:47, Michael Kaufmann wrote:
> Hi Frank,
> One of your theming patches (
> ) has caused
> a problem in many Delphi applications. The edit controls of Delphi
> applications are now created in Unicode mode. I hope you have an idea
> why this happens... Of course Delphi applications are ANSI and expect
> ANSI controls in their windows.

I know.

> 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.
> (dlls/user/winproc.c)

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.

Try this patch:
Unfortunately, it is as-is not CVS-worthy...


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 250 bytes
Desc: OpenPGP digital signature
Url :

More information about the wine-devel mailing list