[SHELLFIND] Move window message constants to header file

This commit is contained in:
Brock Mammen 2019-08-03 12:04:50 -05:00 committed by Giannis Adamopoulos
parent 6d6bc885cb
commit 3583900b17
2 changed files with 13 additions and 4 deletions

View file

@ -200,8 +200,7 @@ LRESULT CSearchBar::OnSearchButtonClicked(WORD wNotifyCode, WORD wID, HWND hWndC
GetSearchResultsFolder(&pShellBrowser, &hwnd, NULL);
if (hwnd)
// TODO: Use message ID in header file
::PostMessageW(hwnd, WM_USER + 1, 0, (LPARAM) StrDupW(L"Starting search..."));
::PostMessageW(hwnd, WM_SEARCH_START, 0, (LPARAM) StrDupW(L"Starting search..."));
return S_OK;
}
@ -213,8 +212,7 @@ LRESULT CSearchBar::OnClicked(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHa
if (SUCCEEDED(hr))
{
LPCWSTR path = L"C:\\readme.txt";
// TODO: Use message ID in header file
::PostMessageW(hwnd, WM_USER, 0, (LPARAM) StrDupW(path));
::PostMessageW(hwnd, WM_SEARCH_ADD_RESULT, 0, (LPARAM) StrDupW(path));
}
return 0;

View file

@ -26,4 +26,15 @@
#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
struct SearchStart
{
WCHAR szPath[MAX_PATH];
WCHAR szFileName[MAX_PATH];
WCHAR szQuery[MAX_PATH];
};
#endif /* _SHELLFIND_PCH_ */