[PATCH] comctl32: support drawing themed push buttons. [try 4] [resend]
Alexandre Julliard
julliard at winehq.org
Tue Nov 4 04:12:45 CST 2008
"Reece Dunn" <msclrhd at 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 at winehq.org
More information about the wine-devel
mailing list