ReactOS 0.4.17-dev-573-g8315b8c
shellfind.h
Go to the documentation of this file.
1#ifndef _SHELLFIND_PCH_
2#define _SHELLFIND_PCH_
3
4#define WIN32_NO_STATUS
5#define _INC_WINDOWS
6#define COM_NO_WINDOWS_H
7
8#include <windef.h>
9#include <winbase.h>
10#include <shlobj.h>
11#include <shlobj_undoc.h>
12#include <shlguid_undoc.h>
13#include <shdeprecated.h>
14#include <tchar.h>
15#include <atlbase.h>
16#include <atlcom.h>
17#include <atlwin.h>
18#include <atlsimpcoll.h>
19#include <atlstr.h>
20#include <shlwapi.h>
21#include <shlwapi_undoc.h>
22#include <undocshell.h>
23#include <shellutils.h>
24#include <strsafe.h>
25#include <wine/debug.h>
26
27#include "../resource.h"
28
29#define WM_SEARCH_START (WM_USER + 0) // Must be ordered before any message with a payload
30#define WM_SEARCH_STOP (WM_USER + 1)
31#define WM_SEARCH_ADD_RESULT (WM_USER + 2)
32#define WM_SEARCH_UPDATE_STATUS (WM_USER + 3)
33#define WM_SEARCH_STOPPED (WM_USER + 9) // Must be ordered after any message with a payload
34
35typedef struct tagLOCATIONITEM
36{
40
41void FreeList(LOCATIONITEM *pLI);
42
44{
48 void Detach() { m_ptr = NULL; }
49};
50
52{
57};
58
59template<class T, class F, class R>
60static INT_PTR FindItemInComboEx(HWND hCombo, T &FindItem, F CompareFunc, R RetMatch)
61{
63 item.mask = CBEIF_LPARAM;
64 item.cchTextMax = 0;
65 for (item.iItem = 0; SendMessageW(hCombo, CBEM_GETITEMW, 0, (LPARAM)&item); item.iItem++)
66 {
67 if (CompareFunc((T&)item.lParam, FindItem) == RetMatch)
68 return item.iItem;
69 }
70 return -1;
71}
72
73static inline bool PathIsOnDrive(PCWSTR Path)
74{
75 return PathGetDriveNumberW(Path) >= 0 && (Path[2] == '\\' || !Path[2]);
76}
77
79{
80 return PathIsUNCW(Path); // FIXME: Verify the path starts with <\\Server\Share>[\]
81}
82
84{
85 // Note: PathIsRelativeW is too forgiving
87}
88
89#endif /* _SHELLFIND_PCH_ */
static PIDLIST_RELATIVE FindItem(IEnumIDList &List, PCWSTR Path)
Definition: CZipFolder.cpp:37
PRTL_UNICODE_STRING_BUFFER Path
static INT CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
Definition: mainwnd.c:243
#define NULL
Definition: types.h:112
#define MAX_PATH
Definition: compat.h:34
BOOL WINAPI PathIsUNCW(const WCHAR *path)
Definition: path.c:989
int WINAPI PathGetDriveNumberW(const WCHAR *path)
Definition: path.c:1786
unsigned int BOOL
Definition: ntddk_ex.h:94
LONG_PTR LPARAM
Definition: minwindef.h:175
static PVOID ptr
Definition: dispmode.c:27
short WCHAR
Definition: pedump.c:58
#define CBEM_GETITEMW
Definition: commctrl.h:3848
#define CBEIF_LPARAM
Definition: commctrl.h:3796
#define T(num)
Definition: thunks.c:311
#define F(x, y, z)
Definition: md5.c:51
#define R(b, x)
Definition: sha2.c:134
static bool PathIsOnDrive(PCWSTR Path)
Definition: shellfind.h:73
static BOOL PathIsOnUnc(PCWSTR Path)
Definition: shellfind.h:78
void FreeList(LOCATIONITEM *pLI)
Definition: CSearchBar.cpp:95
static bool FindFiles_PathIsAbsolute(PCWSTR Path)
Definition: shellfind.h:83
struct tagLOCATIONITEM LOCATIONITEM
static INT_PTR FindItemInComboEx(HWND hCombo, T &FindItem, F CompareFunc, R RetMatch)
Definition: shellfind.h:60
LOCATIONITEM * m_ptr
Definition: shellfind.h:45
ScopedFreeLocationItems(LOCATIONITEM *ptr)
Definition: shellfind.h:46
WCHAR szFileName[MAX_PATH]
Definition: shellfind.h:54
LOCATIONITEM * pPaths
Definition: shellfind.h:53
BOOL SearchHidden
Definition: shellfind.h:56
WCHAR szQuery[MAX_PATH]
Definition: shellfind.h:55
WCHAR szPath[ANYSIZE_ARRAY]
Definition: shellfind.h:38
struct tagLOCATIONITEM * pNext
Definition: shellfind.h:37
int32_t INT_PTR
Definition: typedefs.h:64
const uint16_t * PCWSTR
Definition: typedefs.h:57
#define ANYSIZE_ARRAY
Definition: typedefs.h:46
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)