From a2bd9b44a9fcd1d48048bd071c4210f5e9f4b950 Mon Sep 17 00:00:00 2001 From: Giannis Adamopoulos Date: Sat, 27 Oct 2018 14:01:20 +0300 Subject: [PATCH] [BROWSEUI] Simplify toggling the search band In windows the toolbar itself creates the search shell extension. In ros we send a command to the CShellBrowser to let it handle it itself. Use the same command for showing and hiding it. --- dll/win32/browseui/internettoolbar.cpp | 9 ++------- dll/win32/browseui/shellbrowser.cpp | 18 ++++-------------- 2 files changed, 6 insertions(+), 21 deletions(-) diff --git a/dll/win32/browseui/internettoolbar.cpp b/dll/win32/browseui/internettoolbar.cpp index 6ea5f07393a..705739cd47f 100644 --- a/dll/win32/browseui/internettoolbar.cpp +++ b/dll/win32/browseui/internettoolbar.cpp @@ -1526,13 +1526,8 @@ LRESULT CInternetToolbar::OnUpLevel(WORD wNotifyCode, WORD wID, HWND hWndCtl, BO LRESULT CInternetToolbar::OnSearch(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled) { - OLECMD cmd; - cmd.cmdID = 0x1c; - IUnknown_QueryStatus(fSite, CGID_Explorer, 1, &cmd, NULL); - if (cmd.cmdf & OLECMDF_LATCHED) - return IUnknown_Exec(fSite, CGID_Explorer, 0x1c, 1, NULL, NULL); - else - return IUnknown_Exec(fSite, CLSID_CommonButtons, 0x123, 1, NULL, NULL); + IUnknown_Exec(fSite, CGID_Explorer, 0x1c, 1, NULL, NULL); + return 1; } LRESULT CInternetToolbar::OnFolders(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled) diff --git a/dll/win32/browseui/shellbrowser.cpp b/dll/win32/browseui/shellbrowser.cpp index b1d39028506..72421a456e1 100644 --- a/dll/win32/browseui/shellbrowser.cpp +++ b/dll/win32/browseui/shellbrowser.cpp @@ -2020,6 +2020,10 @@ HRESULT STDMETHODCALLTYPE CShellBrowser::Exec(const GUID *pguidCmdGroup, DWORD n memset(&fCurrentVertBar, 0, sizeof(fCurrentVertBar)); FireCommandStateChangeAll(); } + else + { + OnSearch(); + } return S_OK; case 0x1d: //Toggle History case 0x1e: //Toggle Favorites @@ -2140,20 +2144,6 @@ HRESULT STDMETHODCALLTYPE CShellBrowser::Exec(const GUID *pguidCmdGroup, DWORD n break; } } - else if (IsEqualIID(*pguidCmdGroup, CLSID_CommonButtons)) - { - // Windows seems to use this as proxy for toolbar buttons. - // We use it for search band for now to remove code duplication, - // let's see if it could be useful in the future. - switch (nCmdID) - { - case 0x123: - // Show search band from toolbar - OnSearch(); - return S_OK; - } - return E_NOTIMPL; - } else { return E_NOTIMPL;