[BROWSEUI]
authorGiannis Adamopoulos <gadamopoulos@reactos.org>
Sat, 17 Jun 2017 07:28:35 +0000 (07:28 +0000)
committerGiannis Adamopoulos <gadamopoulos@reactos.org>
Sat, 17 Jun 2017 07:28:35 +0000 (07:28 +0000)
- CShellBrowser: Propagate WM_WININICHANGE to all immediate children.
- CInternetToolbar: Forward WM_WININICHANGE to the menu band to make aware that the flat menus option changed.

svn path=/trunk/; revision=75071

reactos/dll/win32/browseui/internettoolbar.cpp
reactos/dll/win32/browseui/internettoolbar.h
reactos/dll/win32/browseui/shellbrowser.cpp

index 8b5717b..f546314 100644 (file)
@@ -1850,3 +1850,24 @@ LRESULT CInternetToolbar::OnLUp(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &b
     return 0;
 }
 
+LRESULT CInternetToolbar::OnWinIniChange(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
+{
+    HRESULT hr;
+    HWND hwndMenu;
+
+    hr = IUnknown_GetWindow(fMenuBar, &hwndMenu);
+    if (FAILED_UNEXPECTEDLY(hr))
+        return 0;
+
+    CComPtr<IWinEventHandler> menuWinEventHandler;
+    hr = fMenuBar->QueryInterface(IID_PPV_ARG(IWinEventHandler, &menuWinEventHandler));
+    if (FAILED_UNEXPECTEDLY(hr))
+        return 0;
+
+    LRESULT lres;
+    hr = menuWinEventHandler->OnWinEvent(hwndMenu, uMsg, wParam, lParam, &lres);
+    if (FAILED_UNEXPECTEDLY(hr))
+        return 0;
+
+    return lres;
+}
index 4c919ba..b8d8f1c 100644 (file)
@@ -195,6 +195,7 @@ public:
     LRESULT OnLDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
     LRESULT OnLUp(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
     LRESULT OnMouseMove(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
+    LRESULT OnWinIniChange(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
 
     BEGIN_MSG_MAP(CInternetToolbar)
         COMMAND_ID_HANDLER(IDM_GOTO_BACK, OnTravelBack)
@@ -215,6 +216,7 @@ public:
         MESSAGE_HANDLER(WM_LBUTTONDOWN, OnLDown)
         MESSAGE_HANDLER(WM_LBUTTONUP, OnLUp)
         MESSAGE_HANDLER(WM_MOUSEMOVE, OnMouseMove)
+        MESSAGE_HANDLER(WM_WININICHANGE, OnWinIniChange)
     END_MSG_MAP()
 
     DECLARE_REGISTRY_RESOURCEID(IDR_INTERNETTOOLBAR)
index 871ce77..be978ae 100644 (file)
@@ -593,6 +593,7 @@ public:
     LRESULT OnInitMenuPopup(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
     LRESULT OnSetFocus(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
     LRESULT RelayMsgToShellView(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
+    LRESULT PropagateMessage(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
     LRESULT OnClose(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled);
     LRESULT OnFolderOptions(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled);
     LRESULT OnMapNetworkDrive(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled);
@@ -638,6 +639,7 @@ public:
         MESSAGE_HANDLER(WM_MEASUREITEM, RelayMsgToShellView)
         MESSAGE_HANDLER(WM_DRAWITEM, RelayMsgToShellView)
         MESSAGE_HANDLER(WM_MENUSELECT, RelayMsgToShellView)
+        MESSAGE_HANDLER(WM_WININICHANGE, PropagateMessage)
         COMMAND_ID_HANDLER(IDM_FILE_CLOSE, OnClose)
         COMMAND_ID_HANDLER(IDM_TOOLS_FOLDEROPTIONS, OnFolderOptions)
         COMMAND_ID_HANDLER(IDM_TOOLS_MAPNETWORKDRIVE, OnMapNetworkDrive)
@@ -3508,6 +3510,12 @@ LRESULT CShellBrowser::RelayMsgToShellView(UINT uMsg, WPARAM wParam, LPARAM lPar
     return 0;
 }
 
+LRESULT CShellBrowser::PropagateMessage(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
+{
+    SHPropagateMessage(m_hWnd, uMsg, wParam, lParam, TRUE);
+    return 0;
+}
+
 LRESULT CShellBrowser::OnClose(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled)
 {
     return SendMessage(WM_CLOSE);