WM_GETTEXTLENGTH change in winproc.c

Alexandre Julliard julliard at winehq.com
Sat Aug 18 15:19:35 CDT 2001


Gerard Patel <gerard.patel at nerim.net> writes:

> I don't understand it :
> 
>      case WM_GETTEXTLENGTH:
>     719     case CB_GETLBTEXTLEN:
>     720     case LB_GETTEXTLEN:
>     721         /* there may be one DBCS char for each Unicode char */
>     722         return result * 2;
> 
> This has a bad effect on one of my test apps - returns a length of 12
> for a text of 6 characters, displays funny symbols after the text.
> 
> The Unicode window proc returns 6, why the unicode/ascii conversion
> should make it 12 ? The Api returns number of chars, not bytes.

The idea is that 6 Unicode chars can yield more than 6 ASCII chars
with DBCS text. The MSDN doc states that WM_GETTEXTLENGTH can return
more than the actual size when mixing ASCII and Unicode.

What does the app do exactly?  Maybe there are cases where the
conversion can be avoided.

-- 
Alexandre Julliard
julliard at winehq.com




More information about the wine-devel mailing list