WM_GETTEXTLENGTH returns double size

Andriy Palamarchuk apa3a at yahoo.com
Sat Jun 15 10:07:31 CDT 2002

--- Shachar Shemesh <wine-devel at sun.consumer.org.il>
> The WM_GETTEXTLENGTH MSDN only says that this should
> be the number of 
> TCHARs returned. nothing about it being an upper
> bound. If so, any time 
> we reach this code, we potentially return the wrong
> value, and hence my 
> suggestion for a "FIXME" there.

It also says: "Under certain conditions, the
DefWindowProc function returns a value that is larger
than the actual length of the text. This occurs with
certain mixtures of ANSI and Unicode, and is due to
the system allowing for the possible existence of
double-byte character set (DBCS) characters within the
text. The return value, however, will always be at
least as large as the actual length of the text; you
can thus always use it to guide buffer allocation."

So, I assume that correct application *should* account
on such possibility, but I do not account that all
applications do ;-)


Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup

More information about the wine-devel mailing list