Musst du nicht die doppelte Länge an Speicher reservieren? WM_GETTEXTLENGTH gibt dochnur die Anzahl der Zeichen zurück:
Zitat:
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;
Aber
Unicode verwendet doch 2 Byte pro Zeichen.