Commit 3cf5d768 authored by Alexander Lakhin's avatar Alexander Lakhin Committed by Michael Stefaniuc

user32: Send the correct WM_CTLCOLOR* message in button WM_SETTEXT handler.

Signed-off-by: 's avatarSebastian Lackner <sebastian@fds-team.de> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org> (cherry picked from commit 35ab5f44) Signed-off-by: 's avatarMichael Stefaniuc <mstefani@winehq.org>
parent 87fb7048
......@@ -389,13 +389,18 @@ LRESULT ButtonWndProc_common(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam,
HBRUSH hbrush;
RECT client, rc;
HWND parent = GetParent(hWnd);
UINT message = (btn_type == BS_PUSHBUTTON ||
btn_type == BS_DEFPUSHBUTTON ||
btn_type == BS_USERBUTTON ||
btn_type == BS_OWNERDRAW) ?
WM_CTLCOLORBTN : WM_CTLCOLORSTATIC;
if (!parent) parent = hWnd;
hbrush = (HBRUSH)SendMessageW(parent, WM_CTLCOLORSTATIC,
(WPARAM)hdc, (LPARAM)hWnd);
hbrush = (HBRUSH)SendMessageW(parent, message,
(WPARAM)hdc, (LPARAM)hWnd);
if (!hbrush) /* did the app forget to call DefWindowProc ? */
hbrush = (HBRUSH)DefWindowProcW(parent, WM_CTLCOLORSTATIC,
(WPARAM)hdc, (LPARAM)hWnd);
hbrush = (HBRUSH)DefWindowProcW(parent, message,
(WPARAM)hdc, (LPARAM)hWnd);
GetClientRect(hWnd, &client);
rc = client;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment