ReactOS  0.4.15-dev-1377-ga59cecd
CFindFolder.h
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS Search Shell Extension
3  * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4  * PURPOSE: Search results folder
5  * COPYRIGHT: Copyright 2019 Brock Mammen
6  */
7 
8 #pragma once
9 
10 #include "shellfind.h"
11 
12 class CFindFolder :
13  public CWindowImpl<CFindFolder>,
14  public CComCoClass<CFindFolder, &CLSID_FindFolder>,
15  public CComObjectRootEx<CComMultiThreadModelNoCS>,
16  public IShellFolder2,
17  public IPersistFolder2,
18  public IShellFolderViewCB,
19  public IConnectionPointContainerImpl<CFindFolder>,
20  public IConnectionPointImpl<CFindFolder, &DIID_DSearchCommandEvents>
21 {
22  // *** IShellFolder2 methods ***
24 
26 
27  STDMETHODIMP GetDefaultColumn(DWORD dwRes, ULONG *pSort, ULONG *pDisplay);
28 
29  STDMETHODIMP GetDefaultColumnState(UINT iColumn, DWORD *pcsFlags);
30 
32 
33  STDMETHODIMP GetDetailsOf(PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *pDetails);
34 
36 
37 
38  // *** IShellFolder methods ***
39  STDMETHODIMP ParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, ULONG *pchEaten,
40  PIDLIST_RELATIVE *ppidl, ULONG *pdwAttributes);
41 
42  STDMETHODIMP EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList);
43 
44  STDMETHODIMP BindToObject(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut);
45 
46  STDMETHODIMP BindToStorage(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut);
47 
49 
50  STDMETHODIMP CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *ppvOut);
51 
53 
54  STDMETHODIMP GetUIObjectOf(HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT *prgfInOut,
55  LPVOID *ppvOut);
56 
57 
59  STDMETHODIMP SetNameOf(HWND hwndOwner, PCUITEMID_CHILD pidl, LPCOLESTR lpName, DWORD dwFlags,
60  PITEMID_CHILD *pPidlOut);
61 
64 
65 private:
71 
72  void NotifyConnections(DISPID id);
74 
77 
78 
79  // *** IPersistFolder methods ***
81 
82 
83  // *** IPersist methods ***
84  STDMETHODIMP GetClassID(CLSID *pClassId);
85 
86  // *** Message handlers ***
88 
89  LRESULT StopSearch(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
90 
91  LRESULT AddResult(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
92 
94 
95 public:
96  CFindFolder();
97 
99 
101 
103 
105  CONNECTION_POINT_ENTRY(DIID_DSearchCommandEvents)
107 
113  END_MSG_MAP()
114 
116  COM_INTERFACE_ENTRY_IID(IID_IShellFolder2, IShellFolder2)
117  COM_INTERFACE_ENTRY_IID(IID_IShellFolder, IShellFolder)
118  COM_INTERFACE_ENTRY_IID(IID_IShellFolderViewCB, IShellFolderViewCB)
119  COM_INTERFACE_ENTRY_IID(IID_IPersistFolder2, IPersistFolder2)
120  COM_INTERFACE_ENTRY_IID(IID_IPersistFolder, IPersistFolder)
123  END_COM_MAP()
124 };
125 
STDMETHODIMP BindToStorage(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut)
#define WM_SEARCH_ADD_RESULT
Definition: shellfind.h:31
#define REFIID
Definition: guiddef.h:118
STDMETHODIMP GetDefaultColumnState(UINT iColumn, DWORD *pcsFlags)
STDMETHODIMP GetDefaultSearchGUID(GUID *pguid)
HANDLE m_hStopEvent
Definition: CFindFolder.h:70
LPITEMIDLIST m_pidl
Definition: CFindFolder.h:66
interface IBindCtx * LPBC
Definition: objfwd.h:18
REFIID riid
Definition: precomp.h:44
const GUID IID_IPersist
Definition: proxy.cpp:14
_In_ LPCSTR lpName
Definition: winbase.h:2752
const GUID IID_IConnectionPointContainer
const ITEMID_CHILD UNALIGNED * PCUITEMID_CHILD
Definition: shtypes.idl:70
#define DECLARE_NOT_AGGREGATABLE(x)
Definition: atlcom.h:611
#define WM_SEARCH_START
Definition: shellfind.h:29
LRESULT StartSearch(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
UINT_PTR WPARAM
Definition: windef.h:207
static DWORD WINAPI SearchThreadProc(LPVOID lpParameter)
static LPOLESTR
Definition: stg_prop.c:27
LRESULT StopSearch(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
WPARAM wParam
Definition: combotst.c:138
STDMETHODIMP GetDetailsEx(PCUITEMID_CHILD pidl, const SHCOLUMNID *pscid, VARIANT *pv)
STDMETHODIMP MessageSFVCB(UINT uMsg, WPARAM wParam, LPARAM lParam)
const PCUITEMID_CHILD * PCUITEMID_CHILD_ARRAY
Definition: shtypes.idl:71
unsigned int BOOL
Definition: ntddk_ex.h:94
STDMETHODIMP GetDetailsOf(PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *pDetails)
STDMETHODIMP GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET pName)
#define STDMETHODIMP
Definition: basetyps.h:43
STDMETHODIMP BindToObject(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut)
STDMETHODIMP GetClassID(CLSID *pClassId)
LONG_PTR LPARAM
Definition: windef.h:208
CComPtr< IShellFolder2 > m_pisfInner
Definition: CFindFolder.h:67
#define BEGIN_COM_MAP(x)
Definition: atlcom.h:541
static LPSTR pName
Definition: security.c:75
STDMETHODIMP GetDefaultColumn(DWORD dwRes, ULONG *pSort, ULONG *pDisplay)
LRESULT UpdateStatus(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
#define END_MSG_MAP()
Definition: atlwin.h:1799
#define WINAPI
Definition: msvc.h:6
unsigned long DWORD
Definition: ntddk_ex.h:95
STDMETHODIMP GetCurFolder(PIDLIST_ABSOLUTE *pidl)
STDMETHODIMP GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *rgfInOut)
STDMETHODIMP CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *ppvOut)
STDMETHODIMP GetUIObjectOf(HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT *prgfInOut, LPVOID *ppvOut)
STDMETHODIMP CompareIDs(LPARAM lParam, PCUIDLIST_RELATIVE pidl1, PCUIDLIST_RELATIVE pidl2)
void NotifyConnections(DISPID id)
#define IDR_FINDFOLDER
Definition: resource.h:109
#define BEGIN_CONNECTION_POINT_MAP(x)
Definition: atlcom.h:1424
STDMETHODIMP EnumSearches(IEnumExtraSearch **ppenum)
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
LPVOID lpParameter
Definition: kernel32.h:241
#define DECLARE_REGISTRY_RESOURCEID(x)
Definition: atlcom.h:605
static VARIANTARG static DISPID
Definition: ordinal.c:49
#define END_CONNECTION_POINT_MAP()
Definition: atlcom.h:1429
#define COM_INTERFACE_ENTRY_IID(iid, x)
Definition: atlcom.h:561
CComPtr< IShellBrowser > m_shellBrowser
Definition: CFindFolder.h:69
STDMETHODIMP Initialize(PCIDLIST_ABSOLUTE pidl)
unsigned int UINT
Definition: ndis.h:50
CComPtr< IShellFolderView > m_shellFolderView
Definition: CFindFolder.h:68
#define BEGIN_MSG_MAP(theClass)
Definition: atlwin.h:1780
STDMETHODIMP ParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, ULONG *pchEaten, PIDLIST_RELATIVE *ppidl, ULONG *pdwAttributes)
#define DECLARE_PROTECT_FINAL_CONSTRUCT()
Definition: atlcom.h:639
#define WM_SEARCH_STOP
Definition: shellfind.h:30
#define MESSAGE_HANDLER(msg, func)
Definition: atlwin.h:1808
const ITEMIDLIST_RELATIVE UNALIGNED * PCUIDLIST_RELATIVE
Definition: shtypes.idl:57
STDMETHODIMP SetNameOf(HWND hwndOwner, PCUITEMID_CHILD pidl, LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut)
unsigned int ULONG
Definition: retypes.h:1
STDMETHODIMP MapColumnToSCID(UINT iColumn, SHCOLUMNID *pscid)
STDMETHODIMP EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList)
#define END_COM_MAP()
Definition: atlcom.h:552
#define WM_SEARCH_UPDATE_STATUS
Definition: shellfind.h:32
LONG_PTR LRESULT
Definition: windef.h:209
LRESULT AddResult(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
LPARAM lParam
Definition: combotst.c:139
#define CONNECTION_POINT_ENTRY(iid)
Definition: atlcom.h:1435