Michael Kaufmann : static control: Background of enhanced metafiles.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Jan 17 09:29:37 CST 2006


Module: wine
Branch: refs/heads/master
Commit: 910f4bb50e0e76fd5cd0110be144f684b6aab575
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=910f4bb50e0e76fd5cd0110be144f684b6aab575

Author: Michael Kaufmann <hallo at michael-kaufmann.ch>
Date:   Tue Jan 17 16:01:40 2006 +0100

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.

---

 dlls/user/static.c |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/dlls/user/static.c b/dlls/user/static.c
index 408a152..a3483c6 100644
--- a/dlls/user/static.c
+++ b/dlls/user/static.c
@@ -708,17 +708,18 @@ static void STATIC_PaintBitmapfn(HWND hw
 static void STATIC_PaintEnhMetafn(HWND hwnd, HDC hdc, DWORD style )
 {
     HENHMETAFILE hEnhMetaFile;
-
-    /* message is still sent, even if the returned brush is not used */
-    SendMessageW( GetParent(hwnd), WM_CTLCOLORSTATIC,
-                                   (WPARAM)hdc, (LPARAM)hwnd );
-
+    RECT rc;
+    HBRUSH hbrush;
+    
+    GetClientRect(hwnd, &rc);
+    hbrush = STATIC_SendWmCtlColorStatic(hwnd, hdc);
+    FillRect(hdc, &rc, hbrush);
     if ((hEnhMetaFile = (HENHMETAFILE)GetWindowLongPtrW( hwnd, HICON_GWL_OFFSET )))
     {
-        RECT clientRect;
-        if(GetObjectType(hEnhMetaFile) != OBJ_ENHMETAFILE) return;
-        GetClientRect(hwnd, &clientRect);
-        PlayEnhMetaFile(hdc, hEnhMetaFile, &clientRect);
+        /* The control's current font is not selected into the
+           device context! */
+        if (GetObjectType(hEnhMetaFile) == OBJ_ENHMETAFILE)
+            PlayEnhMetaFile(hdc, hEnhMetaFile, &rc);
     }
 }
 




More information about the wine-cvs mailing list