2019-07-19 02:15:01 +00:00
|
|
|
/*
|
2019-08-23 20:51:43 +00:00
|
|
|
* PROJECT: ReactOS Search Shell Extension
|
|
|
|
* LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
|
|
|
|
* PURPOSE: Search UI
|
|
|
|
* COPYRIGHT: Copyright 2019 Brock Mammen
|
2019-07-19 02:15:01 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "shellfind.h"
|
|
|
|
|
|
|
|
class CSearchBar :
|
|
|
|
public CComCoClass<CSearchBar, &CLSID_FileSearchBand>,
|
|
|
|
public CComObjectRootEx<CComMultiThreadModelNoCS>,
|
|
|
|
public IDeskBand,
|
|
|
|
public IObjectWithSite,
|
|
|
|
public IInputObject,
|
|
|
|
public IPersistStream,
|
|
|
|
public IDispatch,
|
2019-08-21 02:17:01 +00:00
|
|
|
public CDialogImpl<CSearchBar>
|
2019-07-19 02:15:01 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
private:
|
|
|
|
// *** BaseBarSite information ***
|
2019-08-24 14:40:43 +00:00
|
|
|
CComPtr<IUnknown> m_pSite;
|
|
|
|
CComPtr<IAddressEditBox> m_AddressEditBox;
|
|
|
|
BOOL m_bVisible;
|
2019-07-19 02:15:01 +00:00
|
|
|
|
2019-07-20 18:05:03 +00:00
|
|
|
HRESULT GetSearchResultsFolder(IShellBrowser **ppShellBrowser, HWND *pHwnd, IShellFolder **ppShellFolder);
|
2019-08-27 13:17:12 +00:00
|
|
|
BOOL GetAddressEditBoxPath(WCHAR *szPath);
|
2019-08-21 02:17:01 +00:00
|
|
|
void SetSearchInProgress(BOOL bInProgress);
|
2019-08-25 22:03:44 +00:00
|
|
|
HRESULT TrySubscribeToSearchEvents();
|
2019-07-19 02:15:01 +00:00
|
|
|
|
|
|
|
// *** ATL event handlers ***
|
2019-08-21 02:17:01 +00:00
|
|
|
LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
|
2019-07-19 02:15:01 +00:00
|
|
|
LRESULT OnSetFocus(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
|
2019-08-21 02:17:01 +00:00
|
|
|
LRESULT OnSearchButtonClicked(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled);
|
|
|
|
LRESULT OnStopButtonClicked(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled);
|
|
|
|
LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
|
2019-07-19 02:15:01 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
CSearchBar();
|
|
|
|
virtual ~CSearchBar();
|
|
|
|
|
|
|
|
// *** IOleWindow methods ***
|
|
|
|
virtual HRESULT STDMETHODCALLTYPE GetWindow(HWND *lphwnd);
|
|
|
|
virtual HRESULT STDMETHODCALLTYPE ContextSensitiveHelp(BOOL fEnterMode);
|
|
|
|
|
|
|
|
// *** IDockingWindow methods ***
|
|
|
|
virtual HRESULT STDMETHODCALLTYPE CloseDW(DWORD dwReserved);
|
|
|
|
virtual HRESULT STDMETHODCALLTYPE ResizeBorderDW(const RECT *prcBorder, IUnknown *punkToolbarSite, BOOL fReserved);
|
|
|
|
virtual HRESULT STDMETHODCALLTYPE ShowDW(BOOL fShow);
|
|
|
|
|
|
|
|
// *** IDeskBand methods ***
|
|
|
|
virtual HRESULT STDMETHODCALLTYPE GetBandInfo(DWORD dwBandID, DWORD dwViewMode, DESKBANDINFO *pdbi);
|
|
|
|
|
|
|
|
// *** IObjectWithSite methods ***
|
|
|
|
virtual HRESULT STDMETHODCALLTYPE SetSite(IUnknown *pUnkSite);
|
|
|
|
virtual HRESULT STDMETHODCALLTYPE GetSite(REFIID riid, void **ppvSite);
|
|
|
|
|
|
|
|
// *** IInputObject methods ***
|
|
|
|
virtual HRESULT STDMETHODCALLTYPE UIActivateIO(BOOL fActivate, LPMSG lpMsg);
|
|
|
|
virtual HRESULT STDMETHODCALLTYPE HasFocusIO();
|
|
|
|
virtual HRESULT STDMETHODCALLTYPE TranslateAcceleratorIO(LPMSG lpMsg);
|
|
|
|
|
|
|
|
// *** IPersist methods ***
|
|
|
|
virtual HRESULT STDMETHODCALLTYPE GetClassID(CLSID *pClassID);
|
|
|
|
|
|
|
|
// *** IPersistStream methods ***
|
|
|
|
virtual HRESULT STDMETHODCALLTYPE IsDirty();
|
|
|
|
virtual HRESULT STDMETHODCALLTYPE Load(IStream *pStm);
|
|
|
|
virtual HRESULT STDMETHODCALLTYPE Save(IStream *pStm, BOOL fClearDirty);
|
|
|
|
virtual HRESULT STDMETHODCALLTYPE GetSizeMax(ULARGE_INTEGER *pcbSize);
|
|
|
|
|
|
|
|
// *** IDispatch methods ***
|
|
|
|
virtual HRESULT STDMETHODCALLTYPE GetTypeInfoCount(UINT *pctinfo);
|
|
|
|
virtual HRESULT STDMETHODCALLTYPE GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo);
|
|
|
|
virtual HRESULT STDMETHODCALLTYPE GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId);
|
|
|
|
virtual HRESULT STDMETHODCALLTYPE Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr);
|
|
|
|
|
2019-08-21 02:17:01 +00:00
|
|
|
enum { IDD = IDD_SEARCH_DLG };
|
|
|
|
|
2019-07-19 02:15:01 +00:00
|
|
|
DECLARE_REGISTRY_RESOURCEID(IDR_EXPLORERBAND)
|
|
|
|
DECLARE_NOT_AGGREGATABLE(CSearchBar)
|
|
|
|
|
|
|
|
DECLARE_PROTECT_FINAL_CONSTRUCT()
|
|
|
|
|
|
|
|
BEGIN_COM_MAP(CSearchBar)
|
|
|
|
COM_INTERFACE_ENTRY_IID(IID_IDispatch, IDispatch)
|
2019-08-25 22:03:44 +00:00
|
|
|
COM_INTERFACE_ENTRY_IID(DIID_DWebBrowserEvents, IDispatch)
|
2019-08-21 02:17:01 +00:00
|
|
|
COM_INTERFACE_ENTRY_IID(DIID_DSearchCommandEvents, IDispatch)
|
2019-07-19 02:15:01 +00:00
|
|
|
COM_INTERFACE_ENTRY2_IID(IID_IOleWindow, IOleWindow, IDeskBand)
|
|
|
|
COM_INTERFACE_ENTRY2_IID(IID_IDockingWindow, IDockingWindow, IDeskBand)
|
|
|
|
COM_INTERFACE_ENTRY_IID(IID_IDeskBand, IDeskBand)
|
|
|
|
COM_INTERFACE_ENTRY_IID(IID_IObjectWithSite, IObjectWithSite)
|
|
|
|
COM_INTERFACE_ENTRY_IID(IID_IInputObject, IInputObject)
|
|
|
|
COM_INTERFACE_ENTRY2_IID(IID_IPersist, IPersist, IPersistStream)
|
|
|
|
COM_INTERFACE_ENTRY_IID(IID_IPersistStream, IPersistStream)
|
|
|
|
END_COM_MAP()
|
|
|
|
|
|
|
|
BEGIN_MSG_MAP(CSearchBar)
|
2019-08-21 02:17:01 +00:00
|
|
|
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
|
2019-07-19 02:15:01 +00:00
|
|
|
MESSAGE_HANDLER(WM_SETFOCUS, OnSetFocus)
|
2019-08-21 02:17:01 +00:00
|
|
|
MESSAGE_HANDLER(WM_SIZE, OnSize)
|
|
|
|
COMMAND_HANDLER(IDC_SEARCH_BUTTON, BN_CLICKED, OnSearchButtonClicked)
|
|
|
|
COMMAND_HANDLER(IDC_SEARCH_STOP_BUTTON, BN_CLICKED, OnStopButtonClicked)
|
2019-07-19 02:15:01 +00:00
|
|
|
END_MSG_MAP()
|
|
|
|
};
|