[01/13] comctl32/ipaddress: Use cached colors instead of GetSysColor for IPAddress control

Nikolay Sivov bunglehead at gmail.com
Mon May 18 12:19:15 CDT 2009


Changelog:
    - Use cached colors instead of GetSysColor for IPAddress control

>From 0ee02ca3c82245d689b6bf7cdf56fd33567db56c Mon Sep 17 00:00:00 2001
From: Nikolay Sivov <bunglehead at gmail.com>
Date: Mon, 18 May 2009 18:57:19 +0400
Subject: Use cached colors instead of GetSysColor for IPAddress control

---
 dlls/comctl32/ipaddress.c |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/dlls/comctl32/ipaddress.c b/dlls/comctl32/ipaddress.c
index a90f6e9..42ac703 100644
--- a/dlls/comctl32/ipaddress.c
+++ b/dlls/comctl32/ipaddress.c
@@ -158,18 +158,18 @@ static LRESULT IPADDRESS_Draw (const IPADDRESS_INFO *infoPtr, HDC hdc)
     GetClientRect (infoPtr->Self, &rect);
 
     if (infoPtr->Enabled) {
-        bgCol = COLOR_WINDOW;
-        fgCol = COLOR_WINDOWTEXT;
+        bgCol = comctl32_color.clrWindow;
+        fgCol = comctl32_color.clrWindowText;
     } else {
-        bgCol = COLOR_3DFACE;
-        fgCol = COLOR_GRAYTEXT;
+        bgCol = comctl32_color.clr3dFace;
+        fgCol = comctl32_color.clrGrayText;
     }
     
     FillRect (hdc, &rect, (HBRUSH)(DWORD_PTR)(bgCol+1));
     DrawEdge (hdc, &rect, EDGE_SUNKEN, BF_RECT | BF_ADJUST);
     
-    SetBkColor  (hdc, GetSysColor(bgCol));
-    SetTextColor(hdc, GetSysColor(fgCol));
+    SetBkColor  (hdc, bgCol);
+    SetTextColor(hdc, fgCol);
 
     for (i = 0; i < 3; i++) {
         GetWindowRect (infoPtr->Part[i].EditHwnd, &rcPart);
@@ -595,6 +595,10 @@ IPADDRESS_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 	    }
 	    break;
 
+        case WM_SYSCOLORCHANGE:
+            COMCTL32_RefreshSysColors();
+            return 0;
+
         case IPM_CLEARADDRESS:
             IPADDRESS_ClearAddress (infoPtr);
 	    break;
-- 
1.5.6.5







More information about the wine-patches mailing list