Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=14113 Signed-off-by: Jeff Smith whydoubt@gmail.com --- dlls/user32/button.c | 2 +- dlls/user32/static.c | 3 ++- dlls/user32/tests/colormsg.c | 3 --- 3 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/dlls/user32/button.c b/dlls/user32/button.c index bbb56edb792..9b73381353c 100644 --- a/dlls/user32/button.c +++ b/dlls/user32/button.c @@ -188,7 +188,7 @@ static HBRUSH BUTTON_BrushSendMessage( HWND hwnd, HDC hDC, UINT message )
hBrush = (HBRUSH)SendMessageW( parent, message, (WPARAM)hDC, (LPARAM)hwnd ); /* did the app forget to call defwindowproc ? */ - if (!hBrush) + if (!hBrush || GetObjectType(hBrush) != OBJ_BRUSH) hBrush = (HBRUSH)DefWindowProcW( parent, message, (WPARAM)hDC, (LPARAM)hwnd ); return hBrush; } diff --git a/dlls/user32/static.c b/dlls/user32/static.c index 72e49e15e8f..32f19a90277 100644 --- a/dlls/user32/static.c +++ b/dlls/user32/static.c @@ -293,7 +293,8 @@ static HBRUSH STATIC_SendWmCtlColorStatic(HWND hwnd, HDC hdc) if (!parent) parent = hwnd; hBrush = (HBRUSH) SendMessageW( parent, WM_CTLCOLORSTATIC, (WPARAM)hdc, (LPARAM)hwnd ); - if (!hBrush) /* did the app forget to call DefWindowProc ? */ + /* did the app forget to call DefWindowProc ? */ + if (!hBrush || GetObjectType(hBrush) != OBJ_BRUSH) { /* FIXME: DefWindowProc should return different colors if a manifest is present */ diff --git a/dlls/user32/tests/colormsg.c b/dlls/user32/tests/colormsg.c index 5916d59403c..e65d286e856 100644 --- a/dlls/user32/tests/colormsg.c +++ b/dlls/user32/tests/colormsg.c @@ -150,11 +150,8 @@ static void test_style_message(const char *class, int style, LONG inside_x, LONG (tests[i].bkcolor != CLR_INVALID) ? tests[i].bkcolor : RGB(255, 255, 255); ocolor_exp = (tests[i].brushcolor == CLR_INVALID || is_pushbutton || is_simple || is_groupbox) ? ocolor0 : tests[i].brushcolor; - todo_wine_if(tests[i].brush != NULL && tests[i].brushcolor == CLR_INVALID && !is_pushbutton) ok(icolor == icolor_exp, "(%s,%#x,%d) Expected color %#x inside text area, got %#x\n", class, style, i, icolor_exp, icolor); - todo_wine_if(tests[i].brush != NULL && tests[i].brushcolor == CLR_INVALID && !is_pushbutton && - !is_simple && !is_groupbox) ok(ocolor == ocolor_exp, "(%s,%#x,%d) Expected color %#x outside text area, got %#x\n", class, style, i, ocolor_exp, ocolor); }