[SHELLFIND] Add stop search command

This commit is contained in:
Brock Mammen 2019-08-20 16:14:12 -05:00 committed by Giannis Adamopoulos
parent 41d7b3700d
commit 41f9ad120d
3 changed files with 16 additions and 5 deletions

View file

@ -266,6 +266,16 @@ LRESULT CFindFolder::StartSearch(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &
return S_OK;
}
LRESULT CFindFolder::StopSearch(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
{
if (m_hStopEvent)
{
SetEvent(m_hStopEvent);
m_hStopEvent = NULL;
}
return 0;
}
LRESULT CFindFolder::AddResult(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
{
if (!lParam)

View file

@ -2,9 +2,6 @@
#include "shellfind.h"
#define SWM_ADD_ITEM (WM_USER + 0)
#define SWM_UPDATE_STATUS (WM_USER + 1)
class CFindFolder :
public CWindowImpl<CFindFolder>,
public CComCoClass<CFindFolder, &CLSID_FindFolder>,
@ -87,6 +84,8 @@ private:
// *** Message handlers ***
LRESULT StartSearch(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
LRESULT StopSearch(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
LRESULT AddResult(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
LRESULT UpdateStatus(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
@ -106,6 +105,7 @@ public:
BEGIN_MSG_MAP(CFindFolder)
MESSAGE_HANDLER(WM_SEARCH_START, StartSearch)
MESSAGE_HANDLER(WM_SEARCH_STOP, StopSearch)
MESSAGE_HANDLER(WM_SEARCH_ADD_RESULT, AddResult)
MESSAGE_HANDLER(WM_SEARCH_UPDATE_STATUS, UpdateStatus)
END_MSG_MAP()

View file

@ -27,8 +27,9 @@
#include "../resource.h"
#define WM_SEARCH_START WM_USER + 0
#define WM_SEARCH_ADD_RESULT WM_USER + 1
#define WM_SEARCH_UPDATE_STATUS WM_USER + 2
#define WM_SEARCH_STOP WM_USER + 1
#define WM_SEARCH_ADD_RESULT WM_USER + 2
#define WM_SEARCH_UPDATE_STATUS WM_USER + 3
struct SearchStart
{