[PATCH 2/2] user32: Erase backgrounds of owner-drawn buttons with the default color.
Alex Henrie
alexhenrie24 at gmail.com
Tue Jun 23 01:59:09 CDT 2015
---
dlls/user32/button.c | 8 +-------
dlls/user32/tests/msg.c | 1 -
2 files changed, 1 insertion(+), 8 deletions(-)
diff --git a/dlls/user32/button.c b/dlls/user32/button.c
index 248df74..7107088 100644
--- a/dlls/user32/button.c
+++ b/dlls/user32/button.c
@@ -268,13 +268,7 @@ LRESULT ButtonWndProc_common(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam,
{
HDC hdc = (HDC)wParam;
RECT rc;
- HBRUSH hBrush;
- HWND parent = GetParent(hWnd);
- if (!parent) parent = hWnd;
- hBrush = (HBRUSH)SendMessageW(parent, WM_CTLCOLORBTN, (WPARAM)hdc, (LPARAM)hWnd);
- if (!hBrush) /* did the app forget to call defwindowproc ? */
- hBrush = (HBRUSH)DefWindowProcW(parent, WM_CTLCOLORBTN,
- (WPARAM)hdc, (LPARAM)hWnd);
+ HBRUSH hBrush = GetSysColorBrush(COLOR_BTNFACE);
GetClientRect(hWnd, &rc);
FillRect(hdc, &rc, hBrush);
}
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c
index a515550..d28154c 100644
--- a/dlls/user32/tests/msg.c
+++ b/dlls/user32/tests/msg.c
@@ -5353,7 +5353,6 @@ static const struct message WmSetFontButtonSeq[] =
{ WM_PAINT, sent },
{ WM_ERASEBKGND, sent|defwinproc|optional },
{ WM_CTLCOLORBTN, sent|defwinproc },
- { WM_CTLCOLORBTN, sent|defwinproc|optional }, /* FIXME: Wine sends it twice for BS_OWNERDRAW */
{ 0 }
};
static const struct message WmSetFontStaticSeq[] =
--
2.4.4
More information about the wine-patches
mailing list