Re: [PATCH] comctl32: support drawing themed push buttons. [try 4] [resend]
"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
Hi, I have the feeling that some of the drawing code is not correct and should use information which is buried inside the theme file. Things like content margins, text positions and things like that. I think it also requires test cases on what has to be done when a property isn't set in the theme. Roderick -- Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger
2008/11/5 Roderick Colenbrander <thunderbird2k(a)gmx.net>:
Hi,
I have the feeling that some of the drawing code is not correct and should use information which is buried inside the theme file. Things like content margins, text positions and things like that. I think it also requires test cases on what has to be done when a property isn't set in the theme.
Having had some experience with writing custom controls for Windows that support theming, I haven't had to query explicitly for the various properties. All of this should be handled by the uxtheme logic in the various API calls. That said, I suspect the code is missing a GetThemeBackgroundContentRect call. - Reece
participants (3)
-
Alexandre Julliard -
Reece Dunn -
Roderick Colenbrander