ReactOS 0.4.16-dev-1097-g530d26a
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
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
34typedef struct tagLOCATIONITEM
35{
39
40void FreeList(LOCATIONITEM *pLI);
41
43{
47 void Detach() { m_ptr = NULL; }
48};
49
51{
56};
57
58template<class T, class F, class R>
59static INT_PTR FindItemInComboEx(HWND hCombo, T &FindItem, F CompareFunc, R RetMatch)
60{
62 item.mask = CBEIF_LPARAM;
63 item.cchTextMax = 0;
64 for (item.iItem = 0; SendMessageW(hCombo, CBEM_GETITEMW, 0, (LPARAM)&item); item.iItem++)
65 {
66 if (CompareFunc((T&)item.lParam, FindItem) == RetMatch)
67 return item.iItem;
68 }
69 return -1;
70}
71
72static inline bool PathIsOnDrive(PCWSTR Path)
73{
74 return PathGetDriveNumberW(Path) >= 0 && (Path[2] == '\\' || !Path[2]);
75}
76
78{
79 return PathIsUNCW(Path); // FIXME: Verify the path starts with <\\Server\Share>[\]
80}
81
82static inline bool PathIsAbsolute(PCWSTR Path)
83{
84 // Note: PathIsRelativeW is too forgiving
86}
87
88#endif /* _SHELLFIND_PCH_ */
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
int WINAPI PathGetDriveNumberW(const WCHAR *path)
Definition: path.c:553
BOOL WINAPI PathIsUNCW(LPCWSTR lpszPath)
Definition: path.c:2272
unsigned int BOOL
Definition: ntddk_ex.h:94
#define T
Definition: mbstring.h:31
static PVOID ptr
Definition: dispmode.c:27
static ATOM item
Definition: dde.c:856
#define CBEM_GETITEMW
Definition: commctrl.h:3848
#define CBEIF_LPARAM
Definition: commctrl.h:3796
#define F(x, y, z)
Definition: md5.c:51
#define R(b, x)
Definition: sha2.c:134
static bool PathIsAbsolute(PCWSTR Path)
Definition: shellfind.h:82
static bool PathIsOnDrive(PCWSTR Path)
Definition: shellfind.h:72
static BOOL PathIsOnUnc(PCWSTR Path)
Definition: shellfind.h:77
void FreeList(LOCATIONITEM *pLI)
Definition: CSearchBar.cpp:95
struct tagLOCATIONITEM LOCATIONITEM
static INT_PTR FindItemInComboEx(HWND hCombo, T &FindItem, F CompareFunc, R RetMatch)
Definition: shellfind.h:59
LOCATIONITEM * m_ptr
Definition: shellfind.h:44
ScopedFreeLocationItems(LOCATIONITEM *ptr)
Definition: shellfind.h:45
WCHAR szFileName[MAX_PATH]
Definition: shellfind.h:53
LOCATIONITEM * pPaths
Definition: shellfind.h:52
BOOL SearchHidden
Definition: shellfind.h:55
WCHAR szQuery[MAX_PATH]
Definition: shellfind.h:54
WCHAR szPath[ANYSIZE_ARRAY]
Definition: shellfind.h:37
struct tagLOCATIONITEM * pNext
Definition: shellfind.h:36
int32_t INT_PTR
Definition: typedefs.h:64
const uint16_t * PCWSTR
Definition: typedefs.h:57
#define ANYSIZE_ARRAY
Definition: typedefs.h:46
LONG_PTR LPARAM
Definition: windef.h:208
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
__wchar_t WCHAR
Definition: xmlstorage.h:180