Thema: Delphi WM_GETTEXT + Unicode

Einzelnen Beitrag anzeigen

Benutzerbild von Luckie
Luckie

Registriert seit: 29. Mai 2002
37.621 Beiträge
 
Delphi 2006 Professional
 
#2

Re: WM_GETTEXT + Unicode

  Alt 22. Okt 2004, 08:51
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.
Michael
Ein Teil meines Codes würde euch verunsichern.
  Mit Zitat antworten Zitat