Author: gadamopoulos
Date: Fri May 5 09:01:15 2017
New Revision: 74479
URL:
http://svn.reactos.org/svn/reactos?rev=74479&view=rev
Log:
[SHELL32] -CMenuDeskBar: Handle WM_NCPAINT and paint the border with the correct color
when it has the flat style.
Modified:
trunk/reactos/dll/win32/shell32/shellmenu/CMenuDeskBar.cpp
trunk/reactos/dll/win32/shell32/shellmenu/CMenuDeskBar.h
Modified: trunk/reactos/dll/win32/shell32/shellmenu/CMenuDeskBar.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shellmen…
==============================================================================
--- trunk/reactos/dll/win32/shell32/shellmenu/CMenuDeskBar.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/shellmenu/CMenuDeskBar.cpp [iso-8859-1] Fri May 5
09:01:15 2017
@@ -817,6 +817,28 @@
return 0;
}
+LRESULT CMenuDeskBar::_OnNcPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL
&bHandled)
+{
+ /* If it is a flat style menu we need to handle WM_NCPAINT
+ * and paint the border with the right colour */
+ if ((GetStyle() & WS_BORDER) == 0)
+ {
+ /* This isn't a flat style menu. */
+ bHandled = FALSE;
+ return 0;
+ }
+
+ HDC hdc;
+ RECT rcWindow;
+
+ hdc = GetWindowDC();
+ GetWindowRect(&rcWindow);
+ OffsetRect(&rcWindow, -rcWindow.left, -rcWindow.top);
+ FrameRect(hdc, &rcWindow, GetSysColorBrush(COLOR_BTNSHADOW));
+ ReleaseDC(hdc);
+ return 0;
+}
+
HRESULT CMenuDeskBar::_AdjustForTheme(BOOL bFlatStyle)
{
DWORD style = bFlatStyle ? WS_BORDER : WS_CLIPCHILDREN|WS_DLGFRAME;
Modified: trunk/reactos/dll/win32/shell32/shellmenu/CMenuDeskBar.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shellmen…
==============================================================================
--- trunk/reactos/dll/win32/shell32/shellmenu/CMenuDeskBar.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/shellmenu/CMenuDeskBar.h [iso-8859-1] Fri May 5
09:01:15 2017
@@ -73,6 +73,7 @@
MESSAGE_HANDLER(WM_ACTIVATEAPP, _OnAppActivate)
MESSAGE_HANDLER(WM_MOUSEACTIVATE, _OnMouseActivate)
MESSAGE_HANDLER(WM_WININICHANGE , _OnWinIniChange)
+ MESSAGE_HANDLER(WM_NCPAINT, _OnNcPaint)
END_MSG_MAP()
BEGIN_COM_MAP(CMenuDeskBar)
@@ -140,6 +141,7 @@
LRESULT _OnMouseActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL
&bHandled);
LRESULT _OnAppActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
LRESULT _OnWinIniChange(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL
&bHandled);
+ LRESULT _OnNcPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
HRESULT _AdjustForTheme(BOOL bFlatStyle);
BOOL _IsSubMenuParent(HWND hwnd);