4 Nov
2008
4 Nov
'08
10:12 a.m.
"Reece Dunn" <msclrhd(a)googlemail.com> writes:
+static WCHAR *get_button_text(HWND hwnd, int *len) +{ + WCHAR *text; + *len = GetWindowTextLengthW(hwnd); + text = HeapAlloc(GetProcessHeap(), 0, (*len + 1) * sizeof(WCHAR)); + if (text) + GetWindowTextW(hwnd, text, *len + 1); + return text; +}
You shouldn't return the length you got from GetWindowTextLength, it can sometimes be larger than necessary. Use the actual length of the string you fetched. -- Alexandre Julliard julliard(a)winehq.org