comctl32/ipaddress: Use cached colors instead of GetSysColor for IPAddress control.
This commit is contained in:
parent
bdd4e0b48b
commit
8806b1e83e
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue