Author: dquintana Date: Mon Feb 24 13:05:24 2014 New Revision: 62320
URL: http://svn.reactos.org/svn/reactos?rev=62320&view=rev Log: [RSHELL] * CMenuBand: Fix menu colors. CORE-7881
Modified: branches/shell-experiments/base/shell/rshell/CMenuBand.cpp
Modified: branches/shell-experiments/base/shell/rshell/CMenuBand.cpp URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rsh... ============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuBand.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuBand.cpp [iso-8859-1] Mon Feb 24 13:05:24 2014 @@ -610,6 +610,16 @@ HDC hdc; HBRUSH bgBrush; HBRUSH hotBrush; + NMHDR * hdr; + NMTBCUSTOMDRAW * cdraw; + NMTBHOTITEM * hot; + NMMOUSE * rclick; + NMPGCALCSIZE* csize; + TBBUTTONINFO btni; + BOOL useFlatMenus = FALSE; + COLORREF clrText; + COLORREF clrTextHighlight; +
*theResult = 0; switch (uMsg) @@ -629,12 +639,7 @@ return S_OK;
case WM_NOTIFY: - NMHDR * hdr = reinterpret_cast<LPNMHDR>(lParam); - NMTBCUSTOMDRAW * cdraw; - NMTBHOTITEM * hot; - NMMOUSE * rclick; - NMPGCALCSIZE* csize; - TBBUTTONINFO btni; + hdr = reinterpret_cast<LPNMHDR>(lParam); switch (hdr->code) { case PGN_CALCSIZE: @@ -725,15 +730,13 @@
case CDDS_ITEMPREPAINT:
- cdraw->clrBtnFace = GetSysColor(COLOR_MENU); - cdraw->clrBtnHighlight = GetSysColor(COLOR_MENUHILIGHT); - - cdraw->clrText = GetSysColor(COLOR_MENUTEXT); - cdraw->clrTextHighlight = GetSysColor(COLOR_HIGHLIGHTTEXT); - cdraw->clrHighlightHotTrack = GetSysColor(COLOR_HIGHLIGHTTEXT); + SystemParametersInfo(SPI_GETFLATMENU, 0, &useFlatMenus, 0); + + clrText = GetSysColor(COLOR_MENUTEXT); + clrTextHighlight = GetSysColor(COLOR_HIGHLIGHTTEXT);
bgBrush = GetSysColorBrush(COLOR_MENU); - hotBrush = GetSysColorBrush(COLOR_MENUHILIGHT); + hotBrush = GetSysColorBrush(useFlatMenus ? COLOR_MENUHILIGHT : COLOR_HIGHLIGHT);
rc = cdraw->nmcd.rc; hdc = cdraw->nmcd.hdc; @@ -750,9 +753,13 @@ case CDIS_HOT: case CDIS_FOCUS: FillRect(hdc, &rc, hotBrush); + SetTextColor(hdc, clrTextHighlight); + cdraw->clrText = clrTextHighlight; break; default: FillRect(hdc, &rc, bgBrush); + SetTextColor(hdc, clrText); + cdraw->clrText = clrText; break; }