Alexander Lakhin : user32: Send the correct WM_CTLCOLOR* message in button WM_SETTEXT handler.
Alexandre Julliard
julliard at winehq.org
Thu Jun 16 03:45:41 CDT 2016
Module: wine
Branch: stable
Commit: 3cf5d768a060b42c51e4ba2479cd7eb85ec1b99a
URL: http://source.winehq.org/git/wine.git/?a=commit;h=3cf5d768a060b42c51e4ba2479cd7eb85ec1b99a
Author: Alexander Lakhin <exclusion at gmail.com>
Date: Tue Apr 19 22:14:49 2016 +0200
user32: Send the correct WM_CTLCOLOR* message in button WM_SETTEXT handler.
Signed-off-by: Sebastian Lackner <sebastian at fds-team.de>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 35ab5f4499185f8df0504b95a99613fa4e30440a)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
---
dlls/user32/button.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/dlls/user32/button.c b/dlls/user32/button.c
index 9c52147..efd74f9 100644
--- a/dlls/user32/button.c
+++ b/dlls/user32/button.c
@@ -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;
More information about the wine-cvs
mailing list