Fix an issue that themed buttons are drawn unthemed after receiving a WM_SETTEXT message.
Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com --- dlls/comctl32/button.c | 2 ++ dlls/comctl32/tests/button.c | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/dlls/comctl32/button.c b/dlls/comctl32/button.c index 0dcbb38d202..b5a9ee7f7f6 100644 --- a/dlls/comctl32/button.c +++ b/dlls/comctl32/button.c @@ -743,6 +743,8 @@ static LRESULT CALLBACK BUTTON_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, L DefWindowProcW( hWnd, WM_SETTEXT, wParam, lParam ); if (btn_type == BS_GROUPBOX) /* Yes, only for BS_GROUPBOX */ InvalidateRect( hWnd, NULL, TRUE ); + else if (GetWindowTheme( hWnd )) + RedrawWindow( hWnd, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW ); else paint_button( infoPtr, btn_type, ODA_DRAWENTIRE ); return 1; /* success. FIXME: check text length */ diff --git a/dlls/comctl32/tests/button.c b/dlls/comctl32/tests/button.c index b5e145077e7..f30e9f665e5 100644 --- a/dlls/comctl32/tests/button.c +++ b/dlls/comctl32/tests/button.c @@ -2359,8 +2359,7 @@ static void test_visual(void) SelectObject(mem_dc2, mem_bitmap2); BitBlt(mem_dc2, 0, 0, width, height, button_dc, 0, 0, SRCCOPY);
- todo_wine_if(type == BS_PUSHBOX || (is_theme_active && !(type == BS_OWNERDRAW - || type == BS_COMMANDLINK || type == BS_DEFCOMMANDLINK))) + todo_wine_if(type == BS_PUSHBOX || (is_theme_active && type == BS_GROUPBOX)) ok(equal_dc(mem_dc1, mem_dc2, width, height), "Type %#x: Expected content unchanged.\n", type);
DeleteObject(mem_bitmap2);