[3/6] comctl32/header: Use cached colors instead of querying them again
Nikolay Sivov
bunglehead at gmail.com
Sun May 17 15:12:30 CDT 2009
Changelog:
- Use cached colors instead of querying them again
>From fe2465f9dc89428fe6be87fd620898b97ebf04eb Mon Sep 17 00:00:00 2001
From: Nikolay Sivov <bunglehead at gmail.com>
Date: Sun, 17 May 2009 23:00:04 +0400
Subject: 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",
--
1.5.6.5
More information about the wine-patches
mailing list