Commit 910f4bb5 authored by Michael Kaufmann's avatar Michael Kaufmann Committed by Alexandre Julliard

static control: Background of enhanced metafiles.

- Always paint the background of static controls displaying enhanced metafiles. - Also paint the background if there's no metafile to display.
parent 7effdb0b
...@@ -708,17 +708,18 @@ static void STATIC_PaintBitmapfn(HWND hwnd, HDC hdc, DWORD style ) ...@@ -708,17 +708,18 @@ static void STATIC_PaintBitmapfn(HWND hwnd, HDC hdc, DWORD style )
static void STATIC_PaintEnhMetafn(HWND hwnd, HDC hdc, DWORD style ) static void STATIC_PaintEnhMetafn(HWND hwnd, HDC hdc, DWORD style )
{ {
HENHMETAFILE hEnhMetaFile; HENHMETAFILE hEnhMetaFile;
RECT rc;
/* message is still sent, even if the returned brush is not used */ HBRUSH hbrush;
SendMessageW( GetParent(hwnd), WM_CTLCOLORSTATIC,
(WPARAM)hdc, (LPARAM)hwnd ); GetClientRect(hwnd, &rc);
hbrush = STATIC_SendWmCtlColorStatic(hwnd, hdc);
FillRect(hdc, &rc, hbrush);
if ((hEnhMetaFile = (HENHMETAFILE)GetWindowLongPtrW( hwnd, HICON_GWL_OFFSET ))) if ((hEnhMetaFile = (HENHMETAFILE)GetWindowLongPtrW( hwnd, HICON_GWL_OFFSET )))
{ {
RECT clientRect; /* The control's current font is not selected into the
if(GetObjectType(hEnhMetaFile) != OBJ_ENHMETAFILE) return; device context! */
GetClientRect(hwnd, &clientRect); if (GetObjectType(hEnhMetaFile) == OBJ_ENHMETAFILE)
PlayEnhMetaFile(hdc, hEnhMetaFile, &clientRect); PlayEnhMetaFile(hdc, hEnhMetaFile, &rc);
} }
} }
......
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