[SHELLFIND] Remove unnecessary data member for focus
[reactos.git] / dll / win32 / browseui / shellfind / CSearchBar.h
index 5ab67b4..c2df78e 100644 (file)
@@ -33,20 +33,26 @@ class CSearchBar :
     public IWinEventHandler,
     public INamespaceProxy,
     public IDispatch,
-    public CWindowImpl<CSearchBar>
+    public CDialogImpl<CSearchBar>
 {
 
 private:
     // *** BaseBarSite information ***
     CComPtr<IUnknown> pSite;
+    CComPtr<IAddressEditBox> fAddressEditBox;
     BOOL fVisible;
-    BOOL bFocused;
 
-    void InitializeSearchBar();
+    HRESULT GetSearchResultsFolder(IShellBrowser **ppShellBrowser, HWND *pHwnd, IShellFolder **ppShellFolder);
+    BOOL GetAddressEditBoxPath(WCHAR (&szPath)[MAX_PATH]);
+    void SetSearchInProgress(BOOL bInProgress);
     HRESULT ExecuteCommand(CComPtr<IContextMenu>& menu, UINT nCmd);
 
     // *** ATL event handlers ***
+    LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
     LRESULT OnSetFocus(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
+    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);
 
 public:
     CSearchBar();
@@ -109,6 +115,8 @@ public:
     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);
 
+    enum { IDD = IDD_SEARCH_DLG };
+
     DECLARE_REGISTRY_RESOURCEID(IDR_EXPLORERBAND)
     DECLARE_NOT_AGGREGATABLE(CSearchBar)
 
@@ -116,6 +124,7 @@ public:
 
     BEGIN_COM_MAP(CSearchBar)
         COM_INTERFACE_ENTRY_IID(IID_IDispatch, IDispatch)
+        COM_INTERFACE_ENTRY_IID(DIID_DSearchCommandEvents, IDispatch)
         COM_INTERFACE_ENTRY_IID(IID_IWinEventHandler, IWinEventHandler)
         COM_INTERFACE_ENTRY_IID(IID_IBandNavigate, IBandNavigate)
         COM_INTERFACE_ENTRY_IID(IID_INamespaceProxy, INamespaceProxy)
@@ -130,9 +139,11 @@ public:
         COM_INTERFACE_ENTRY_IID(IID_IPersistStream, IPersistStream)
     END_COM_MAP()
 
-    DECLARE_WND_CLASS_EX(_T("SrchCompExplorerBar"), 0, COLOR_WINDOW)
-
     BEGIN_MSG_MAP(CSearchBar)
+        MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
         MESSAGE_HANDLER(WM_SETFOCUS, OnSetFocus)
+        MESSAGE_HANDLER(WM_SIZE, OnSize)
+        COMMAND_HANDLER(IDC_SEARCH_BUTTON, BN_CLICKED, OnSearchButtonClicked)
+        COMMAND_HANDLER(IDC_SEARCH_STOP_BUTTON, BN_CLICKED, OnStopButtonClicked)
     END_MSG_MAP()
 };