Nikolay Sivov : comctl32/header: Use cached colors instead of querying them again.

Alexandre Julliard julliard at winehq.org
Mon May 18 08:13:16 CDT 2009


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

Author: Nikolay Sivov <bunglehead at gmail.com>
Date:   Sun May 17 23:00:04 2009 +0400

comctl32/header: Use cached colors instead of querying them again.

---

 dlls/comctl32/header.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/dlls/comctl32/header.c b/dlls/comctl32/header.c
index 88dcec8..5c0b355 100644
--- a/dlls/comctl32/header.c
+++ b/dlls/comctl32/header.c
@@ -300,7 +300,7 @@ HEADER_DrawItem (HEADER_INFO *infoPtr, HDC hdc, INT iItem, BOOL bHotTrack, LRESU
 
     /* Set the colors before sending NM_CUSTOMDRAW so that it can change them */
     SetTextColor(hdc, (bHotTrack && !theme) ? COLOR_HIGHLIGHT : COLOR_BTNTEXT);
-    SetBkColor(hdc, GetSysColor(COLOR_3DFACE));
+    SetBkColor(hdc, comctl32_color.clr3dFace);
 
     if (lCDFlags & CDRF_NOTIFYITEMDRAW && !(phdi->fmt & HDF_OWNERDRAW))
     {
@@ -497,7 +497,7 @@ HEADER_DrawHotDivider(const HEADER_INFO *infoPtr, HDC hdc)
     RECT r;
     
     HEADER_GetHotDividerRect(infoPtr, &r);
-    brush = CreateSolidBrush(GetSysColor(COLOR_HIGHLIGHT));
+    brush = CreateSolidBrush(comctl32_color.clrHighlight);
     FillRect(hdc, &r, brush);
     DeleteObject(brush);
 }
@@ -2067,6 +2067,10 @@ HEADER_WindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
         case WM_SETREDRAW:
             return HEADER_SetRedraw(infoPtr, wParam, lParam);
 
+        case WM_SYSCOLORCHANGE:
+            COMCTL32_RefreshSysColors();
+            return 0;
+
         default:
             if ((msg >= WM_USER) && (msg < WM_APP) && !COMCTL32_IsReflectedMessage(msg))
 		ERR("unknown msg %04x wp=%04lx lp=%08lx\n",




More information about the wine-cvs mailing list