Commit 3c81ca83 authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

comctl32/button: Use themed painting when possible for handling WM_SETTEXT.

Fix an issue that themed buttons are drawn unthemed after receiving a WM_SETTEXT message. Signed-off-by: 's avatarZhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 9dd0c07d
......@@ -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 */
......
......@@ -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);
......
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