comctl32: Always paint SS_BITMAP static control background with WM_CTLCOLORSTATIC brush.

This is consistent with the behaviour of other static control styles.

Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>
This commit is contained in:
Jinoh Kang 2022-03-15 02:40:03 +09:00 committed by Alexandre Julliard
parent e3ba22e39b
commit 0b07bb8566
2 changed files with 4 additions and 4 deletions

View file

@ -849,13 +849,16 @@ static void STATIC_PaintBitmapfn(HWND hwnd, HDC hdc, HBRUSH hbrush, DWORD style
{
HDC hMemDC;
HBITMAP hBitmap, oldbitmap;
RECT rcClient;
GetClientRect( hwnd, &rcClient );
FillRect( hdc, &rcClient, hbrush );
if ((hBitmap = STATIC_GetImage( hwnd, IMAGE_BITMAP, style ))
&& (GetObjectType(hBitmap) == OBJ_BITMAP)
&& (hMemDC = CreateCompatibleDC( hdc )))
{
BITMAP bm;
RECT rcClient;
LOGBRUSH brush;
BLENDFUNCTION blend = { AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
struct static_extra_info *extra = get_extra_ptr( hwnd, FALSE );
@ -870,10 +873,8 @@ static void STATIC_PaintBitmapfn(HWND hwnd, HDC hdc, HBRUSH hbrush, DWORD style
if (brush.lbStyle == BS_SOLID)
SetBkColor(hdc, brush.lbColor);
}
GetClientRect(hwnd, &rcClient);
if (style & SS_CENTERIMAGE)
{
FillRect( hdc, &rcClient, hbrush );
rcClient.left = (rcClient.right - rcClient.left)/2 - bm.bmWidth/2;
rcClient.top = (rcClient.bottom - rcClient.top)/2 - bm.bmHeight/2;
rcClient.right = rcClient.left + bm.bmWidth;

View file

@ -118,7 +118,6 @@ static void test_updates(int style)
{
HDC hdc = GetDC(hStatic);
COLORREF colour = GetPixel(hdc, 10, 10);
todo_wine
ok(colour == 0, "Unexpected pixel color.\n");
ReleaseDC(hStatic, hdc);
}