[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.
This commit is contained in:
Giannis Adamopoulos 2018-10-27 14:01:20 +03:00
parent a0c5cafce5
commit a2bd9b44a9
2 changed files with 6 additions and 21 deletions

View file

@ -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)

View file

@ -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;