mirror of
https://github.com/reactos/reactos.git
synced 2024-06-30 18:01:07 +00:00
[SHELLFIND] Add search bar click handler for testing search results
This commit is contained in:
parent
06fd04d7b0
commit
7c937bd9ef
|
@ -134,6 +134,29 @@ LRESULT CSearchBar::OnSearchButtonClicked(WORD wNotifyCode, WORD wID, HWND hWndC
|
||||||
return pShellBrowser->BrowseObject(findFolderPidl, 0);
|
return pShellBrowser->BrowseObject(findFolderPidl, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LRESULT CSearchBar::OnClicked(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
|
||||||
|
{
|
||||||
|
HRESULT hr;
|
||||||
|
CComPtr<IShellBrowser> pShellBrowser;
|
||||||
|
hr = IUnknown_QueryService(pSite, SID_SShellBrowser, IID_PPV_ARG(IShellBrowser, &pShellBrowser));
|
||||||
|
if (FAILED_UNEXPECTEDLY(hr))
|
||||||
|
return hr;
|
||||||
|
CComPtr<IShellView> pShellView;
|
||||||
|
hr = pShellBrowser->QueryActiveShellView(&pShellView);
|
||||||
|
if (FAILED_UNEXPECTEDLY(hr))
|
||||||
|
return hr;
|
||||||
|
HWND hwnd;
|
||||||
|
hr = pShellView->GetWindow(&hwnd);
|
||||||
|
if (FAILED_UNEXPECTEDLY(hr))
|
||||||
|
return hr;
|
||||||
|
|
||||||
|
LPWSTR path = (LPWSTR) L"C:\\readme.txt";
|
||||||
|
|
||||||
|
// TODO: Use message ID in header file
|
||||||
|
::PostMessageW(hwnd, WM_USER, 0, (LPARAM) StrDupW(path));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// *** IOleWindow methods ***
|
// *** IOleWindow methods ***
|
||||||
HRESULT STDMETHODCALLTYPE CSearchBar::GetWindow(HWND *lphwnd)
|
HRESULT STDMETHODCALLTYPE CSearchBar::GetWindow(HWND *lphwnd)
|
||||||
|
|
|
@ -48,6 +48,7 @@ private:
|
||||||
// *** ATL event handlers ***
|
// *** ATL event handlers ***
|
||||||
LRESULT OnSetFocus(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 OnSearchButtonClicked(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
|
||||||
|
LRESULT OnClicked(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CSearchBar();
|
CSearchBar();
|
||||||
|
@ -136,5 +137,6 @@ public:
|
||||||
BEGIN_MSG_MAP(CSearchBar)
|
BEGIN_MSG_MAP(CSearchBar)
|
||||||
MESSAGE_HANDLER(WM_SETFOCUS, OnSetFocus)
|
MESSAGE_HANDLER(WM_SETFOCUS, OnSetFocus)
|
||||||
COMMAND_CODE_HANDLER(BN_CLICKED, OnSearchButtonClicked)
|
COMMAND_CODE_HANDLER(BN_CLICKED, OnSearchButtonClicked)
|
||||||
|
MESSAGE_HANDLER(WM_LBUTTONDOWN, OnClicked)
|
||||||
END_MSG_MAP()
|
END_MSG_MAP()
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue