Author: gadamopoulos
Date: Thu Dec 18 18:24:01 2014
New Revision: 65742
URL:
http://svn.reactos.org/svn/reactos?rev=65742&view=rev
Log:
[RSHELL]
* Implement using a thin border for the start menu when themes are enabled
CORE-8925
Modified:
trunk/reactos/base/shell/rshell/CMenuBand.cpp
trunk/reactos/base/shell/rshell/CMenuBand.h
trunk/reactos/base/shell/rshell/CMenuDeskBar.cpp
trunk/reactos/base/shell/rshell/CMenuDeskBar.h
trunk/reactos/base/shell/rshell/CMenuToolbars.cpp
trunk/reactos/include/reactos/shlguid_undoc.h
Modified: trunk/reactos/base/shell/rshell/CMenuBand.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/rshell/CMenuBan…
==============================================================================
--- trunk/reactos/base/shell/rshell/CMenuBand.cpp [iso-8859-1] (original)
+++ trunk/reactos/base/shell/rshell/CMenuBand.cpp [iso-8859-1] Thu Dec 18 18:24:01 2014
@@ -699,6 +699,14 @@
{
*theResult = 0;
+ if (uMsg == WM_WININICHANGE && wParam == SPI_SETFLATMENU)
+ {
+ BOOL bFlatMenus;
+ SystemParametersInfo(SPI_GETFLATMENU, 0, &bFlatMenus, 0);
+ AdjustForTheme(bFlatMenus);
+ return S_OK;
+ }
+
if (m_staticToolbar && m_staticToolbar->IsWindowOwner(hWnd) == S_OK)
{
return m_staticToolbar->OnWinEvent(hWnd, uMsg, wParam, lParam, theResult);
@@ -1123,6 +1131,11 @@
return m_popupBar ? S_OK : S_FALSE;
}
+HRESULT CMenuBand::AdjustForTheme(BOOL bFlatStyle)
+{
+ return IUnknown_QueryServiceExec(m_site, SID_SMenuPopup, &CGID_MenuDeskBar, 4,
bFlatStyle, NULL, NULL);
+}
+
HRESULT STDMETHODCALLTYPE CMenuBand::InvalidateItem(LPSMDATA psmd, DWORD dwFlags)
{
UNIMPLEMENTED;
Modified: trunk/reactos/base/shell/rshell/CMenuBand.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/rshell/CMenuBan…
==============================================================================
--- trunk/reactos/base/shell/rshell/CMenuBand.h [iso-8859-1] (original)
+++ trunk/reactos/base/shell/rshell/CMenuBand.h [iso-8859-1] Thu Dec 18 18:24:01 2014
@@ -200,6 +200,8 @@
HRESULT _MenuBarMouseUp(HWND hwnd, INT item);
HRESULT _HasSubMenu();
+ HRESULT AdjustForTheme(BOOL bFlatStyle);
+
BOOL UseBigIcons()
{
return m_useBigIcons;
Modified: trunk/reactos/base/shell/rshell/CMenuDeskBar.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/rshell/CMenuDes…
==============================================================================
--- trunk/reactos/base/shell/rshell/CMenuDeskBar.cpp [iso-8859-1] (original)
+++ trunk/reactos/base/shell/rshell/CMenuDeskBar.cpp [iso-8859-1] Thu Dec 18 18:24:01
2014
@@ -25,8 +25,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(CMenuDeskBar);
-const static GUID CGID_MenuDeskBar = { 0x5C9F0A12, 0x959E, 0x11D0, { 0xA3, 0xA4, 0x00,
0xA0, 0xC9, 0x08, 0x26, 0x36 } };
-
extern "C"
HRESULT WINAPI CMenuDeskBar_Constructor(REFIID riid, LPVOID *ppv)
{
@@ -110,7 +108,7 @@
case 3: // load complete
return S_OK;
case 4: // set font metrics
- return S_OK;
+ return _AdjustForTheme(nCmdexecopt);
}
}
if (IsEqualIID(*pguidCmdGroup, CGID_Explorer))
@@ -693,3 +691,19 @@
#endif
return 0;
}
+
+LRESULT CMenuDeskBar::_OnWinIniChange(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL
&bHandled)
+{
+ if (wParam == SPI_SETFLATMENU)
+ return _OnNotify(uMsg, wParam, lParam, bHandled);
+
+ return 0;
+}
+
+HRESULT CMenuDeskBar::_AdjustForTheme(BOOL bFlatStyle)
+{
+ DWORD style = bFlatStyle ? WS_BORDER : WS_CLIPCHILDREN|WS_DLGFRAME;
+ DWORD mask = WS_BORDER|WS_CLIPCHILDREN|WS_DLGFRAME;
+ SHSetWindowBits(m_hWnd, GWL_STYLE, mask, style);
+ return S_OK;
+}
Modified: trunk/reactos/base/shell/rshell/CMenuDeskBar.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/rshell/CMenuDes…
==============================================================================
--- trunk/reactos/base/shell/rshell/CMenuDeskBar.h [iso-8859-1] (original)
+++ trunk/reactos/base/shell/rshell/CMenuDeskBar.h [iso-8859-1] Thu Dec 18 18:24:01 2014
@@ -70,6 +70,7 @@
MESSAGE_HANDLER(WM_ACTIVATE, _OnActivate)
MESSAGE_HANDLER(WM_ACTIVATEAPP, _OnAppActivate)
MESSAGE_HANDLER(WM_MOUSEACTIVATE, _OnMouseActivate)
+ MESSAGE_HANDLER(WM_WININICHANGE , _OnWinIniChange)
END_MSG_MAP()
BEGIN_COM_MAP(CMenuDeskBar)
@@ -136,7 +137,9 @@
LRESULT _OnActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
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);
+ HRESULT _AdjustForTheme(BOOL bFlatStyle);
BOOL _IsSubMenuParent(HWND hwnd);
HRESULT _CloseBar();
};
Modified: trunk/reactos/base/shell/rshell/CMenuToolbars.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/rshell/CMenuToo…
==============================================================================
--- trunk/reactos/base/shell/rshell/CMenuToolbars.cpp [iso-8859-1] (original)
+++ trunk/reactos/base/shell/rshell/CMenuToolbars.cpp [iso-8859-1] Thu Dec 18 18:24:01
2014
@@ -383,6 +383,9 @@
SetWindowTheme(m_hWnd, L"", L"");
+ SystemParametersInfo(SPI_GETFLATMENU, 0, &m_useFlatMenus, 0);
+ m_menuBand->AdjustForTheme(m_useFlatMenus);
+
// If needed, create the pager.
if (m_usePager)
{
Modified: trunk/reactos/include/reactos/shlguid_undoc.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/shlguid_un…
==============================================================================
--- trunk/reactos/include/reactos/shlguid_undoc.h [iso-8859-1] (original)
+++ trunk/reactos/include/reactos/shlguid_undoc.h [iso-8859-1] Thu Dec 18 18:24:01 2014
@@ -112,12 +112,15 @@
DEFINE_GUID(IID_IAugmentedShellFolder2, 0x8DB3B3F4, 0x6CFE, 0x11D1, 0x8A, 0xE9, 0x00,
0xC0, 0x4F, 0xD9, 0x18, 0xD0);
DEFINE_GUID(IID_IAugmentedShellFolder3, 0x4F755EA8, 0x247D, 0x479B, 0x91, 0x81, 0x22,
0x7D, 0x09, 0xC2, 0xE0, 0x01);
+DEFINE_GUID(CGID_MenuDeskBar, 0x5C9F0A12, 0x959E, 0x11D0, 0xA3, 0xA4, 0x00,
0xA0, 0xC9, 0x08, 0x26, 0x36);
+
#define CGID_IExplorerToolbar IID_IExplorerToolbar
#define SID_IExplorerToolbar IID_IExplorerToolbar
#define SID_ITargetFrame2 IID_ITargetFrame2
#define SID_IWebBrowserApp IID_IWebBrowserApp
#define CGID_IDeskBand IID_IDeskBand
#define CGID_MenuBand CLSID_MenuBand
+
#define SID_STravelLogCursor IID_ITravelLogStg
#define SID_IBandSite IID_IBandSite
#define SID_IFolderView IID_IFolderView