Francois Gouget : comctl32: Send a WM_CTLCOLORSTATIC message and erase the background while painting.

Alexandre Julliard julliard at winehq.org
Mon Sep 26 16:15:14 CDT 2011


Module: wine
Branch: master
Commit: 76b6c8f5170f1f8d95ad38febc8c8cb1b606f067
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=76b6c8f5170f1f8d95ad38febc8c8cb1b606f067

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Mon Sep 26 16:22:40 2011 +0200

comctl32: Send a WM_CTLCOLORSTATIC message and erase the background while painting.

---

 dlls/comctl32/syslink.c |   29 ++++++++++-------------------
 1 files changed, 10 insertions(+), 19 deletions(-)

diff --git a/dlls/comctl32/syslink.c b/dlls/comctl32/syslink.c
index 01d638c..b2dfdad 100644
--- a/dlls/comctl32/syslink.c
+++ b/dlls/comctl32/syslink.c
@@ -832,6 +832,7 @@ static LRESULT SYSLINK_Draw (const SYSLINK_INFO *infoPtr, HDC hdc)
     PDOC_ITEM Current;
     HFONT hOldFont;
     COLORREF OldTextColor, OldBkColor;
+    HBRUSH hBrush;
 
     hOldFont = SelectObject(hdc, infoPtr->Font);
     OldTextColor = SetTextColor(hdc, infoPtr->TextColor);
@@ -843,6 +844,13 @@ static LRESULT SYSLINK_Draw (const SYSLINK_INFO *infoPtr, HDC hdc)
 
     if(rc.right < 0 || rc.bottom < 0) return 0;
 
+    hBrush = (HBRUSH)SendMessageW(infoPtr->Notify, WM_CTLCOLORSTATIC,
+                                  (WPARAM)hdc, (LPARAM)infoPtr->Self);
+    if (!hBrush)
+        hBrush = CreateSolidBrush(infoPtr->BackColor);
+    FillRect(hdc, &rc, hBrush);
+    DeleteObject(hBrush);
+
     for(Current = infoPtr->Items; Current != NULL; Current = Current->Next)
     {
         int n;
@@ -911,23 +919,6 @@ static LRESULT SYSLINK_Paint (const SYSLINK_INFO *infoPtr, HDC hdcParam)
 }
 
 /***********************************************************************
- * SYSLINK_EraseBkgnd
- * Handles the WM_ERASEBKGND message.
- */
-static LRESULT SYSLINK_EraseBkgnd (const SYSLINK_INFO *infoPtr, HDC hdc)
-{
-   HBRUSH hbr;
-   RECT r;
-
-   GetClientRect(infoPtr->Self, &r);
-   hbr = CreateSolidBrush(infoPtr->BackColor);
-   FillRect(hdc, &r, hbr);
-   DeleteObject(hbr);
-
-   return 1;
-}
-
-/***********************************************************************
  *           SYSLINK_SetFont
  * Set new Font for the SysLink control.
  */
@@ -1572,7 +1563,7 @@ static LRESULT WINAPI SysLinkWindowProc(HWND hwnd, UINT message,
         return SYSLINK_Paint (infoPtr, (HDC)wParam);
 
     case WM_ERASEBKGND:
-        return SYSLINK_EraseBkgnd(infoPtr, (HDC)wParam);
+        return 0;
 
     case WM_SETCURSOR:
     {
@@ -1752,7 +1743,7 @@ static LRESULT WINAPI SysLinkWindowProc(HWND hwnd, UINT message,
         infoPtr->HasFocus = FALSE;
         infoPtr->MouseDownID = -1;
         infoPtr->TextColor = comctl32_color.clrWindowText;
-        infoPtr->LinkColor = comctl32_color.clrHotTrackingColor;
+        infoPtr->LinkColor = comctl32_color.clrHighlight;
         infoPtr->VisitedColor = comctl32_color.clrHighlight;
         infoPtr->BackColor = infoPtr->Style & LWS_TRANSPARENT ?
                              comctl32_color.clrWindow : comctl32_color.clrBtnFace;




More information about the wine-cvs mailing list