ReactOS 0.4.16-dev-1401-gf1332c7
CFindFolder Class Reference

#include <CFindFolder.h>

Inheritance diagram for CFindFolder:
Collaboration diagram for CFindFolder:

Public Member Functions

 CFindFolder ()
 
- Public Member Functions inherited from ATL::CWindowImpl< CFindFolder >
HWND Create (HWND hWndParent, _U_RECT rect=NULL, LPCTSTR szWindowName=NULL, DWORD dwStyle=0, DWORD dwExStyle=0, _U_MENUorID MenuOrID=0U, LPVOID lpCreateParam=NULL)
 
- Public Member Functions inherited from ATL::CWindowImplBaseT< TBase, TWinTraits >
 CWindowImplBaseT ()
 
virtual void OnFinalMessage (HWND)
 
BOOL SubclassWindow (HWND hWnd)
 
HWND UnsubclassWindow (BOOL bForce=FALSE)
 
virtual WNDPROC GetWindowProc ()
 
LRESULT DefWindowProc (UINT uMsg, WPARAM wParam, LPARAM lParam)
 
HWND Create (HWND hWndParent, _U_RECT rect, LPCTSTR szWindowName, DWORD dwStyle, DWORD dwExStyle, _U_MENUorID MenuOrID, ATOM atom, LPVOID lpCreateParam)
 
- Public Member Functions inherited from ATL::CWindowImplRoot< TBase >
 CWindowImplRoot ()
 
virtual ~CWindowImplRoot ()
 
- Public Member Functions inherited from ATL::CWindow
 CWindow (HWND hWnd=NULL)
 
 operator HWND () const
 
UINT ArrangeIconicWindows ()
 
void Attach (HWND hWndNew)
 
HDC BeginPaint (LPPAINTSTRUCT lpPaint)
 
BOOL BringWindowToTop ()
 
BOOL CenterWindow (HWND hWndCenter=NULL)
 
BOOL ChangeClipboardChain (HWND hWndNewNext)
 
BOOL CheckDlgButton (int nIDButton, UINT nCheck)
 
BOOL CheckRadioButton (int nIDFirstButton, int nIDLastButton, int nIDCheckButton)
 
HWND ChildWindowFromPoint (POINT point) const
 
HWND ChildWindowFromPointEx (POINT point, UINT uFlags) const
 
BOOL ClientToScreen (LPPOINT lpPoint) const
 
BOOL ClientToScreen (LPRECT lpRect) const
 
HWND Create (LPCTSTR lpstrWndClass, HWND hWndParent, _U_RECT rect=NULL, LPCTSTR szWindowName=NULL, DWORD dwStyle=0, DWORD dwExStyle=0, _U_MENUorID MenuOrID=0U, LPVOID lpCreateParam=NULL)
 
BOOL CreateCaret (HBITMAP pBitmap)
 
BOOL CreateGrayCaret (int nWidth, int nHeight)
 
BOOL CreateSolidCaret (int nWidth, int nHeight)
 
HDWP DeferWindowPos (HDWP hWinPosInfo, HWND hWndInsertAfter, int x, int y, int cx, int cy, UINT uFlags)
 
BOOL DestroyWindow ()
 
HWND Detach ()
 
int DlgDirList (LPTSTR lpPathSpec, int nIDListBox, int nIDStaticPath, UINT nFileType)
 
int DlgDirListComboBox (LPTSTR lpPathSpec, int nIDComboBox, int nIDStaticPath, UINT nFileType)
 
BOOL DlgDirSelect (LPTSTR lpString, int nCount, int nIDListBox)
 
BOOL DlgDirSelectComboBox (LPTSTR lpString, int nCount, int nIDComboBox)
 
void DragAcceptFiles (BOOL bAccept=TRUE)
 
BOOL DrawMenuBar ()
 
BOOL EnableScrollBar (UINT uSBFlags, UINT uArrowFlags=ESB_ENABLE_BOTH)
 
BOOL EnableWindow (BOOL bEnable=TRUE)
 
void EndPaint (LPPAINTSTRUCT lpPaint)
 
BOOL FlashWindow (BOOL bInvert)
 
BOOL GetClientRect (LPRECT lpRect) const
 
HDC GetDC ()
 
HDC GetDCEx (HRGN hRgnClip, DWORD flags)
 
HWND GetDescendantWindow (int nID) const
 
HRESULT GetDlgControl (int nID, REFIID iid, void **ppCtrl)
 
int GetDlgCtrlID () const
 
HRESULT GetDlgHost (int nID, REFIID iid, void **ppHost)
 
HWND GetDlgItem (_In_ int nID) const
 
UINT GetDlgItemInt (_In_ int nID, _Out_opt_ BOOL *lpTrans=NULL, _In_ BOOL bSigned=TRUE) const
 
UINT GetDlgItemText (_In_ int nID, _Out_writes_to_(nMaxCount, return+1) LPTSTR lpStr, _In_ int nMaxCount) const
 
BOOL GetDlgItemText (_In_ int nID, _Inout_ _Outref_result_maybenull_ _Post_z_ BSTR &bstrText) const
 
DWORD GetExStyle () const
 
HFONT GetFont () const
 
DWORD GetHotKey () const
 
HICON GetIcon (BOOL bBigIcon=TRUE) const
 
HWND GetLastActivePopup () const
 
HMENU GetMenu () const
 
HWND GetNextDlgGroupItem (HWND hWndCtl, BOOL bPrevious=FALSE) const
 
HWND GetNextDlgTabItem (HWND hWndCtl, BOOL bPrevious=FALSE) const
 
CWindow GetParent () const
 
BOOL GetScrollInfo (int nBar, LPSCROLLINFO lpScrollInfo)
 
BOOL GetScrollPos (int nBar)
 
BOOL GetScrollRange (int nBar, LPINT lpMinPos, LPINT lpMaxPos) const
 
DWORD GetStyle () const
 
HMENU GetSystemMenu (BOOL bRevert)
 
HWND GetTopLevelParent () const
 
HWND GetTopLevelWindow () const
 
HWND GetTopWindow () const
 
BOOL GetUpdateRect (LPRECT lpRect, BOOL bErase=FALSE)
 
int GetUpdateRgn (HRGN hRgn, BOOL bErase=FALSE)
 
HWND GetWindow (UINT nCmd) const
 
DWORD GetWindowContextHelpId () const
 
HDC GetWindowDC ()
 
LONG GetWindowLong (int nIndex) const
 
LONG_PTR GetWindowLongPtr (int nIndex) const
 
BOOL GetWindowPlacement (WINDOWPLACEMENT *lpwndpl) const
 
DWORD GetWindowProcessID ()
 
BOOL GetWindowRect (LPRECT lpRect) const
 
int GetWindowRgn (HRGN hRgn)
 
int GetWindowText (_Out_writes_to_(nMaxCount, return+1) LPTSTR lpszStringBuf, _In_ int nMaxCount) const
 
BOOL GetWindowText (_Inout_ _Outref_result_maybenull_ _Post_z_ BSTR &bstrText) const
 
int GetWindowTextLength () const
 
DWORD GetWindowThreadID ()
 
WORD GetWindowWord (int nIndex) const
 
void GotoDlgCtrl (HWND hWndCtrl) const
 
BOOL HideCaret ()
 
BOOL HiliteMenuItem (HMENU hMenu, UINT uHiliteItem, UINT uHilite)
 
BOOL Invalidate (BOOL bErase=TRUE)
 
BOOL InvalidateRect (LPCRECT lpRect, BOOL bErase=TRUE)
 
void InvalidateRgn (HRGN hRgn, BOOL bErase=TRUE)
 
BOOL IsChild (const HWND hWnd) const
 
BOOL IsDialogMessage (LPMSG lpMsg)
 
UINT IsDlgButtonChecked (int nIDButton) const
 
BOOL IsIconic () const
 
BOOL IsParentDialog ()
 
BOOL IsWindow () const
 
BOOL IsWindowEnabled () const
 
BOOL IsWindowVisible () const
 
BOOL IsWindowUnicode ()
 
BOOL IsZoomed () const
 
BOOL KillTimer (UINT_PTR nIDEvent)
 
BOOL LockWindowUpdate (BOOL bLock=TRUE)
 
int MapWindowPoints (HWND hWndTo, LPPOINT lpPoint, UINT nCount) const
 
int MapWindowPoints (HWND hWndTo, LPRECT lpRect) const
 
int MessageBox (LPCTSTR lpszText, LPCTSTR lpszCaption=NULL, UINT nType=MB_OK)
 
BOOL ModifyStyle (DWORD dwRemove, DWORD dwAdd, UINT nFlags=0)
 
BOOL ModifyStyleEx (DWORD dwRemove, DWORD dwAdd, UINT nFlags=0)
 
BOOL MoveWindow (int x, int y, int nWidth, int nHeight, BOOL bRepaint=TRUE)
 
void NextDlgCtrl () const
 
BOOL OpenClipboard ()
 
BOOL PostMessage (UINT message, WPARAM wParam=0, LPARAM lParam=0)
 
void PrevDlgCtrl () const
 
void Print (HDC hDC, DWORD dwFlags) const
 
void PrintClient (HDC hDC, DWORD dwFlags) const
 
BOOL RedrawWindow (LPCRECT lpRectUpdate=NULL, HRGN hRgnUpdate=NULL, UINT flags=RDW_INVALIDATE|RDW_UPDATENOW|RDW_ERASE)
 
int ReleaseDC (HDC hDC)
 
BOOL ResizeClient (int nWidth, int nHeight, BOOL bRedraw=FALSE)
 
BOOL ScreenToClient (LPPOINT lpPoint) const
 
BOOL ScrollWindow (int xAmount, int yAmount, LPCRECT lpRect=NULL, LPCRECT lpClipRect=NULL)
 
int ScrollWindowEx (int dx, int dy, LPCRECT lpRectScroll, LPCRECT lpRectClip, HRGN hRgnUpdate, LPRECT lpRectUpdate, UINT flags)
 
LRESULT SendDlgItemMessage (int nID, UINT message, WPARAM wParam=0, LPARAM lParam=0)
 
LRESULT SendMessage (UINT message, WPARAM wParam=0, LPARAM lParam=0)
 
void SendMessageToDescendants (UINT message, WPARAM wParam=0, LPARAM lParam=0, BOOL bDeep=TRUE)
 
BOOL SendNotifyMessage (UINT message, WPARAM wParam=0, LPARAM lParam=0)
 
HWND SetActiveWindow ()
 
HWND SetCapture ()
 
HWND SetClipboardViewer ()
 
int SetDlgCtrlID (int nID)
 
BOOL SetDlgItemInt (int nID, UINT nValue, BOOL bSigned=TRUE)
 
BOOL SetDlgItemText (int nID, LPCTSTR lpszString)
 
HWND SetFocus ()
 
void SetFont (HFONT hFont, BOOL bRedraw=TRUE)
 
int SetHotKey (WORD wVirtualKeyCode, WORD wModifiers)
 
HICON SetIcon (HICON hIcon, BOOL bBigIcon=TRUE)
 
BOOL SetMenu (HMENU hMenu)
 
HWND SetParent (HWND hWndNewParent)
 
void SetRedraw (BOOL bRedraw=TRUE)
 
int SetScrollInfo (int nBar, LPSCROLLINFO lpScrollInfo, BOOL bRedraw=TRUE)
 
int SetScrollPos (int nBar, int nPos, BOOL bRedraw=TRUE)
 
BOOL SetScrollRange (int nBar, int nMinPos, int nMaxPos, BOOL bRedraw=TRUE)
 
UINT_PTR SetTimer (UINT_PTR nIDEvent, UINT nElapse, void(CALLBACK *lpfnTimer)(HWND, UINT, UINT_PTR, DWORD)=NULL)
 
BOOL SetWindowContextHelpId (DWORD dwContextHelpId)
 
LONG SetWindowLong (int nIndex, LONG dwNewLong)
 
LONG_PTR SetWindowLongPtr (int nIndex, LONG_PTR dwNewLong)
 
BOOL SetWindowPlacement (const WINDOWPLACEMENT *lpwndpl)
 
BOOL SetWindowPos (HWND hWndInsertAfter, int x, int y, int cx, int cy, UINT nFlags)
 
int SetWindowRgn (HRGN hRgn, BOOL bRedraw=FALSE)
 
BOOL SetWindowText (LPCTSTR lpszString)
 
WORD SetWindowWord (int nIndex, WORD wNewWord)
 
BOOL ShowCaret ()
 
BOOL ShowOwnedPopups (BOOL bShow=TRUE)
 
BOOL ShowScrollBar (UINT nBar, BOOL bShow=TRUE)
 
BOOL ShowWindow (int nCmdShow)
 
BOOL ShowWindowAsync (int nCmdShow)
 
BOOL UpdateWindow ()
 
BOOL ValidateRect (LPCRECT lpRect)
 
BOOL ValidateRgn (HRGN hRgn)
 
BOOL WinHelp (LPCTSTR lpszHelp, UINT nCmd=HELP_CONTEXT, DWORD dwData=0)
 
- Public Member Functions inherited from ATL::CMessageMap
virtual BOOL ProcessWindowMessage (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT &lResult, DWORD dwMsgMapID)=0
 
- Public Member Functions inherited from ATL::CComObjectRootEx< CComMultiThreadModelNoCS >
 ~CComObjectRootEx ()
 
ULONG InternalAddRef ()
 
ULONG InternalRelease ()
 
void Lock ()
 
void Unlock ()
 
HRESULT _AtlInitialConstruct ()
 
- Public Member Functions inherited from ATL::CComObjectRootBase
 CComObjectRootBase ()
 
 ~CComObjectRootBase ()
 
void SetVoid (void *)
 
HRESULT _AtlFinalConstruct ()
 
HRESULT FinalConstruct ()
 
void InternalFinalConstructAddRef ()
 
void InternalFinalConstructRelease ()
 
void FinalRelease ()
 
HRESULT GetDefaultSearchGUID ([out] GUID *lpguid)
 
HRESULT EnumSearches ([out] IEnumExtraSearch **ppenum)
 
HRESULT GetDefaultColumn ([in] DWORD dwReserved, [out] ULONG *pSort, [out] ULONG *pDisplay)
 
HRESULT GetDefaultColumnState ([in] UINT iColumn, [out] SHCOLSTATEF *pcsFlags)
 
HRESULT GetDetailsEx ([in] PCUITEMID_CHILD pidl, [in] const SHCOLUMNID *pscid, [out] VARIANT *pv)
 
HRESULT GetDetailsOf ([in] PCUITEMID_CHILD pidl, [in] UINT iColumn, [out] SHELLDETAILS *psd)
 
HRESULT MapColumnToSCID ([in] UINT iColumn, [in] SHCOLUMNID *pscid)
 
- Public Member Functions inherited from IShellFolder
HRESULT ParseDisplayName ([in] HWND hwndOwner, [in] LPBC pbcReserved, [in, string] LPOLESTR lpszDisplayName, [out] ULONG *pchEaten, [out] PIDLIST_RELATIVE *ppidl, [in, out, unique] ULONG *pdwAttributes)
 
HRESULT EnumObjects ([in] HWND hwndOwner, [in] SHCONTF grfFlags, [out] IEnumIDList **ppenumIDList)
 
HRESULT BindToObject ([in] PCUIDLIST_RELATIVE pidl, [in] LPBC pbcReserved, [in] REFIID riid, [out, iid_is(riid)] void **ppvOut)
 
HRESULT BindToStorage ([in] PCUIDLIST_RELATIVE pidl, [in] LPBC pbcReserved, [in] REFIID riid, [out, iid_is(riid)] void **ppvObj)
 
HRESULT CompareIDs ([in] LPARAM lParam, [in] PCUIDLIST_RELATIVE pidl1, [in] PCUIDLIST_RELATIVE pidl2)
 
HRESULT CreateViewObject ([in] HWND hwndOwner, [in] REFIID riid, [out, iid_is(riid)] void **ppvOut)
 
HRESULT GetAttributesOf ([in] UINT cidl, [in, size_is(cidl)] PCUITEMID_CHILD_ARRAY apidl, [in, out] SFGAOF *rgfInOut)
 
HRESULT GetUIObjectOf ([in] HWND hwndOwner, [in] UINT cidl, [in, size_is(cidl)] PCUITEMID_CHILD_ARRAY apidl, [in] REFIID riid, [in, out, unique] UINT *prgfInOut, [out, iid_is(riid)] void **ppvOut)
 
HRESULT GetDisplayNameOf ([in] PCUITEMID_CHILD pidl, [in] SHGDNF uFlags, [out] STRRET *lpName)
 
HRESULT SetNameOf ([in] HWND hwnd, [in] PCUITEMID_CHILD pidl, [in, string] LPCOLESTR lpszName, [in] SHGDNF uFlags, [out] PITEMID_CHILD *ppidlOut)
 
- Public Member Functions inherited from IUnknown
HRESULT QueryInterface ([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
 
ULONG AddRef ()
 
ULONG Release ()
 
HRESULT GetCurFolder ([out] PIDLIST_ABSOLUTE *ppidl)
 
HRESULT Initialize ([in] PCIDLIST_ABSOLUTE pidl)
 
HRESULT GetClassID ([out] CLSID *pClassID)
 
- Public Member Functions inherited from ATL::IConnectionPointContainerImpl< CFindFolder >
STDMETHOD() EnumConnectionPoints (IEnumConnectionPoints **ppEnum)
 
STDMETHOD() FindConnectionPoint (REFIID riid, IConnectionPoint **ppCP)
 
HRESULT EnumConnectionPoints ([out] IEnumConnectionPoints **ppEnum)
 
HRESULT FindConnectionPoint ([in] REFIID riid, [out] IConnectionPoint **ppCP)
 
- Public Member Functions inherited from ATL::IConnectionPointImpl< CFindFolder, &DIID_DSearchCommandEvents >
 ~IConnectionPointImpl ()
 
STDMETHOD() _LocCPQueryInterface (REFIID riid, void **ppvObject)
 
STDMETHOD() GetConnectionInterface (IID *piid2)
 
STDMETHOD() GetConnectionPointContainer (IConnectionPointContainer **ppCPC)
 
STDMETHOD() Advise (IUnknown *pUnkSink, DWORD *pdwCookie)
 
STDMETHOD() Unadvise (DWORD dwCookie)
 
STDMETHOD() EnumConnections (IEnumConnections **ppEnum)
 
- Public Member Functions inherited from ATL::_ICPLocator< piid >
STDMETHOD() _LocCPQueryInterface (REFIID riid, void **ppvObject)=0
 
virtual ULONG STDMETHODCALLTYPE AddRef ()=0
 
virtual ULONG STDMETHODCALLTYPE Release ()=0
 

Private Member Functions

STDMETHODIMP GetDefaultSearchGUID (GUID *pguid)
 
STDMETHODIMP EnumSearches (IEnumExtraSearch **ppenum)
 
STDMETHODIMP GetDefaultColumn (DWORD dwRes, ULONG *pSort, ULONG *pDisplay)
 
STDMETHODIMP GetDefaultColumnState (UINT iColumn, DWORD *pcsFlags)
 
STDMETHODIMP GetDetailsEx (PCUITEMID_CHILD pidl, const SHCOLUMNID *pscid, VARIANT *pv)
 
STDMETHODIMP GetDetailsOf (PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *pDetails)
 
STDMETHODIMP MapColumnToSCID (UINT iColumn, SHCOLUMNID *pscid)
 
STDMETHODIMP ParseDisplayName (HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, ULONG *pchEaten, PIDLIST_RELATIVE *ppidl, ULONG *pdwAttributes)
 
STDMETHODIMP EnumObjects (HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList)
 
STDMETHODIMP BindToObject (PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut)
 
STDMETHODIMP BindToStorage (PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut)
 
STDMETHODIMP CompareIDs (LPARAM lParam, PCUIDLIST_RELATIVE pidl1, PCUIDLIST_RELATIVE pidl2)
 
STDMETHODIMP CreateViewObject (HWND hwndOwner, REFIID riid, LPVOID *ppvOut)
 
STDMETHODIMP GetAttributesOf (UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *rgfInOut)
 
STDMETHODIMP GetUIObjectOf (HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT *prgfInOut, LPVOID *ppvOut)
 
STDMETHODIMP GetDisplayNameOf (PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET pName)
 
STDMETHODIMP SetNameOf (HWND hwndOwner, PCUITEMID_CHILD pidl, LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut)
 
STDMETHODIMP MessageSFVCB (UINT uMsg, WPARAM wParam, LPARAM lParam)
 
HRESULT GetFSFolderAndChild (LPCITEMIDLIST pidl, IShellFolder **ppSF, PCUITEMID_CHILD *ppidlLast=NULL)
 
HRESULT GetFSFolder2AndChild (LPCITEMIDLIST pidl, IShellFolder2 **ppSF, PCUITEMID_CHILD *ppidlLast=NULL)
 
void FreePidlArray (HDPA hDpa)
 
HDPA CreateAbsolutePidlArray (UINT cidl, PCUITEMID_CHILD_ARRAY apidl)
 
void NotifyConnections (DISPID id)
 
STDMETHODIMP GetCurFolder (PIDLIST_ABSOLUTE *pidl)
 
STDMETHODIMP Initialize (PCIDLIST_ABSOLUTE pidl)
 
STDMETHODIMP GetClassID (CLSID *pClassId)
 
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)
 

Static Private Member Functions

static int CALLBACK SortItemsForDataObject (void *p1, void *p2, LPARAM lparam)
 
static DWORD WINAPI SearchThreadProc (LPVOID lpParameter)
 

Private Attributes

LPITEMIDLIST m_pidl
 
CComPtr< IShellFolder2m_pisfInner
 
CComPtr< IShellFolder2m_pSfDesktop
 
CComPtr< IShellFolderView > m_shellFolderView
 
CComPtr< IShellBrowserm_shellBrowser
 
HANDLE m_hStopEvent
 

Additional Inherited Members

- Public Types inherited from ATL::CWindowImplRoot< TBase >
enum  { WINSTATE_DESTROYED = 0x00000001 }
 
- Public Types inherited from IShellFolder2
typedef struct IShellFolder2::SHCOLUMNIDLPSHCOLUMNID
 
typedef const SHCOLUMNIDLPCSHCOLUMNID
 
- Public Types inherited from IShellFolder
enum  tagSHGDN {
  SHGDN_NORMAL = 0 , SHGDN_INFOLDER = 1 , SHGDN_FOREDITING = 0x1000 , SHGDN_INCLUDE_NONFILESYS = 0x2000 ,
  SHGDN_FORADDRESSBAR = 0x4000 , SHGDN_FORPARSING = 0x8000
}
 
enum  tagSHCONTF {
  SHCONTF_FOLDERS = 32 , SHCONTF_NONFOLDERS = 64 , SHCONTF_INCLUDEHIDDEN = 128 , SHCONTF_INIT_ON_FIRST_NEXT = 256 ,
  SHCONTF_NETPRINTERSRCH = 512 , SHCONTF_SHAREABLE = 1024 , SHCONTF_STORAGE = 2048 , SHCONTF_NAVIGATION_ENUM = 0x01000 ,
  SHCONTF_FASTITEMS = 0x02000 , SHCONTF_FLATLIST = 0x04000 , SHCONTF_ENABLE_ASYNC = 0x08000 , SHCONTF_INCLUDESUPERHIDDEN = 0x10000
}
 
typedef IShellFolderLPSHELLFOLDER
 
typedef enum IShellFolder::tagSHGDN SHGNO
 
typedef DWORD SHGDNF
 
typedef DWORD SHCONTF
 
typedef ULONG SFGAOF
 
- Public Types inherited from IUnknown
typedef IUnknownLPUNKNOWN
 
- Public Types inherited from IPersistFolder2
typedef IPersistFolder2LPPERSISTFOLDER2
 
- Public Types inherited from IPersistFolder
typedef IPersistFolderLPPERSISTFOLDER
 
- Public Types inherited from IPersist
typedef IPersistLPPERSIST
 
- Public Types inherited from IConnectionPointContainer
typedef IConnectionPointContainerPCONNECTIONPOINTCONTAINER
 
typedef IConnectionPointContainerLPCONNECTIONPOINTCONTAINER
 
- Static Public Member Functions inherited from ATL::CWindowImpl< CFindFolder >
static LPCTSTR GetWndCaption ()
 
- Static Public Member Functions inherited from ATL::CWindowImplBaseT< TBase, TWinTraits >
static DWORD GetWndStyle (DWORD dwStyle)
 
static DWORD GetWndExStyle (DWORD dwExStyle)
 
static LRESULT CALLBACK StartWindowProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static LRESULT CALLBACK WindowProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
- Static Public Member Functions inherited from ATL::CWindow
static LPCTSTR GetWndClassName ()
 
static LRESULT SendMessage (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 
- Static Public Member Functions inherited from ATL::CComCoClass< CFindFolder, &CLSID_FindFolder >
static LPCTSTR WINAPI GetObjectDescription ()
 
- Static Public Member Functions inherited from ATL::CComObjectRootBase
static void WINAPI ObjectMain (bool)
 
static const struct _ATL_CATMAP_ENTRYGetCategoryMap ()
 
static HRESULT WINAPI InternalQueryInterface (void *pThis, const _ATL_INTMAP_ENTRY *pEntries, REFIID iid, void **ppvObject)
 
- Public Attributes inherited from ATL::CWindowImplBaseT< TBase, TWinTraits >
WNDPROC m_pfnSuperWindowProc
 
- Public Attributes inherited from ATL::CWindowImplRoot< TBase >
CWndProcThunk m_thunk
 
const _ATL_MSGm_pCurrentMsg
 
DWORD m_dwState
 
- Public Attributes inherited from ATL::CWindow
HWND m_hWnd
 
- Public Attributes inherited from ATL::CComObjectRootBase
LONG m_dwRef
 
- Public Attributes inherited from ATL::IConnectionPointImpl< CFindFolder, &DIID_DSearchCommandEvents >
CComDynamicUnkArray m_vec
 
- Static Public Attributes inherited from ATL::CWindow
static RECT rcDefault
 

Detailed Description

Definition at line 12 of file CFindFolder.h.

Constructor & Destructor Documentation

◆ CFindFolder()

CFindFolder::CFindFolder ( )

Definition at line 144 of file CFindFolder.cpp.

144 :
145 m_pidl(NULL),
147{
148}
HANDLE m_hStopEvent
Definition: CFindFolder.h:70
LPITEMIDLIST m_pidl
Definition: CFindFolder.h:66
#define NULL
Definition: types.h:112

Member Function Documentation

◆ AddResult()

LRESULT CFindFolder::AddResult ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
private

Definition at line 750 of file CFindFolder.cpp.

751{
752 if (!lParam)
753 return 0;
754
756
757 CComHeapPtr<ITEMIDLIST> lpSearchPidl(_ILCreate(lpPath));
758 if (lpSearchPidl)
759 {
760 UINT uItemIndex;
761 m_shellFolderView->AddObject(lpSearchPidl, &uItemIndex);
762 }
763
764 return 0;
765}
CComPtr< IShellFolderView > m_shellFolderView
Definition: CFindFolder.h:68
LPARAM lParam
Definition: combotst.c:139
LPITEMIDLIST _ILCreate(LPCWSTR lpString, ULONG Index)
Definition: fontpidl.cpp:10
unsigned int UINT
Definition: ndis.h:50
WCHAR * LPWSTR
Definition: xmlstorage.h:184

◆ BindToObject()

STDMETHODIMP CFindFolder::BindToObject ( PCUIDLIST_RELATIVE  pidl,
LPBC  pbcReserved,
REFIID  riid,
LPVOID ppvOut 
)
private

Definition at line 875 of file CFindFolder.cpp.

876{
877 HRESULT hr;
878 CComPtr<IShellFolder> pInnerFolder;
879 PCUITEMID_CHILD pidlChild;
880 if (FAILED_UNEXPECTEDLY(hr = GetFSFolderAndChild(pidl, &pInnerFolder, &pidlChild)))
881 return hr;
882 return pInnerFolder->BindToObject(pidlChild, pbcReserved, riid, ppvOut);
883}
HRESULT GetFSFolderAndChild(LPCITEMIDLIST pidl, IShellFolder **ppSF, PCUITEMID_CHILD *ppidlLast=NULL)
#define FAILED_UNEXPECTEDLY
Definition: utils.cpp:30
REFIID riid
Definition: atlbase.h:39
HRESULT hr
Definition: shlfolder.c:183
const ITEMID_CHILD UNALIGNED * PCUITEMID_CHILD
Definition: shtypes.idl:70

◆ BindToStorage()

STDMETHODIMP CFindFolder::BindToStorage ( PCUIDLIST_RELATIVE  pidl,
LPBC  pbcReserved,
REFIID  riid,
LPVOID ppvOut 
)
private

Definition at line 885 of file CFindFolder.cpp.

886{
888 return E_NOTIMPL;
889}
#define UNIMPLEMENTED
Definition: ntoskrnl.c:15
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ CompareIDs()

STDMETHODIMP CFindFolder::CompareIDs ( LPARAM  lParam,
PCUIDLIST_RELATIVE  pidl1,
PCUIDLIST_RELATIVE  pidl2 
)
private

Implements IShellFolder.

Definition at line 891 of file CFindFolder.cpp.

892{
893 WORD wColumn = LOWORD(lParam);
894 switch (wColumn)
895 {
896 case COL_NAME_INDEX: // Name
897 break;
898 case COL_LOCATION_INDEX: // Path
899 return MAKE_COMPARE_HRESULT(StrCmpW(_ILGetPath(pidl1), _ILGetPath(pidl2)));
900 case COL_RELEVANCE_INDEX: // Relevance
901 return E_NOTIMPL;
902 default: // Default columns
903 wColumn -= _countof(g_ColumnDefs) - 1;
904 break;
905 }
906 return m_pisfInner->CompareIDs(MAKELONG(wColumn, HIWORD(lParam)), _ILGetFSPidl(pidl1), _ILGetFSPidl(pidl2));
907}
static LPCWSTR _ILGetPath(LPCITEMIDLIST pidl)
static LPCITEMIDLIST _ILGetFSPidl(LPCITEMIDLIST pidl)
static FolderViewColumns g_ColumnDefs[]
Definition: CFontExt.cpp:34
CComPtr< IShellFolder2 > m_pisfInner
Definition: CFindFolder.h:67
#define COL_NAME_INDEX
Definition: resource.h:187
#define COL_RELEVANCE_INDEX
Definition: resource.h:189
#define COL_LOCATION_INDEX
Definition: resource.h:188
int WINAPI StrCmpW(const WCHAR *str, const WCHAR *comp)
Definition: string.c:450
unsigned short WORD
Definition: ntddk_ex.h:93
#define LOWORD(l)
Definition: pedump.c:82
#define MAKE_COMPARE_HRESULT(x)
Definition: shellutils.h:660
#define _countof(array)
Definition: sndvol32.h:70
#define MAKELONG(a, b)
Definition: typedefs.h:249
#define HIWORD(l)
Definition: typedefs.h:247

◆ CreateAbsolutePidlArray()

HDPA CFindFolder::CreateAbsolutePidlArray ( UINT  cidl,
PCUITEMID_CHILD_ARRAY  apidl 
)
private

Definition at line 251 of file CFindFolder.cpp.

252{
253 HDPA hDpa = DPA_Create(cidl / 2);
254 if (hDpa)
255 {
256 for (UINT i = 0; i < cidl; ++i)
257 {
258 PIDLIST_ABSOLUTE pidl = _ILCreateAbsolute(apidl[i]);
259 if (pidl)
260 {
261 if (DPA_InsertPtr(hDpa, i, pidl) >= 0)
262 continue;
263 ILFree(pidl);
264 }
265 FreePidlArray(hDpa);
266 return NULL;
267 }
268 }
269 return hDpa;
270}
static PIDLIST_ABSOLUTE _ILCreateAbsolute(LPCITEMIDLIST pidlChild)
void FreePidlArray(HDPA hDpa)
HDPA WINAPI DPA_Create(INT nGrow)
Definition: dpa.c:950
INT WINAPI DPA_InsertPtr(HDPA hdpa, INT i, LPVOID p)
Definition: dpa.c:591
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
void WINAPI ILFree(LPITEMIDLIST pidl)
Definition: pidl.c:1045
Definition: dpa.c:49

Referenced by GetUIObjectOf().

◆ CreateViewObject()

STDMETHODIMP CFindFolder::CreateViewObject ( HWND  hwndOwner,
REFIID  riid,
LPVOID ppvOut 
)
private

Definition at line 909 of file CFindFolder.cpp.

910{
911 if (riid == IID_IShellView)
912 {
913 SFV_CREATE sfvparams = {};
914 sfvparams.cbSize = sizeof(SFV_CREATE);
915 sfvparams.pshf = this;
916 sfvparams.psfvcb = this;
917 HRESULT hr = SHCreateShellFolderView(&sfvparams, (IShellView **) ppvOut);
919 {
920 return hr;
921 }
922
923 return ((IShellView * ) * ppvOut)->QueryInterface(IID_PPV_ARG(IShellFolderView, &m_shellFolderView));
924 }
925 return E_NOINTERFACE;
926}
HRESULT WINAPI SHCreateShellFolderView(const SFV_CREATE *pcsfv, IShellView **ppsv)
Definition: CDefView.cpp:4814
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
struct _SFV_CREATE SFV_CREATE
IShellFolderViewCB * psfvcb
Definition: shlobj.h:1365
UINT cbSize
Definition: shlobj.h:1362
IShellFolder * pshf
Definition: shlobj.h:1363
#define E_NOINTERFACE
Definition: winerror.h:2364
#define IID_PPV_ARG(Itype, ppType)

◆ EnumObjects()

STDMETHODIMP CFindFolder::EnumObjects ( HWND  hwndOwner,
DWORD  dwFlags,
LPENUMIDLIST *  ppEnumIDList 
)
private

Definition at line 869 of file CFindFolder.cpp.

870{
871 *ppEnumIDList = NULL;
872 return S_FALSE;
873}
#define S_FALSE
Definition: winerror.h:2357

◆ EnumSearches()

STDMETHODIMP CFindFolder::EnumSearches ( IEnumExtraSearch **  ppenum)
private

Implements IShellFolder2.

Definition at line 785 of file CFindFolder.cpp.

786{
788 return E_NOTIMPL;
789}

◆ FreePidlArray()

void CFindFolder::FreePidlArray ( HDPA  hDpa)
private

Definition at line 246 of file CFindFolder.cpp.

247{
249}
static int CALLBACK ILFreeHelper(void *pItem, void *pCaller)
void WINAPI DPA_DestroyCallback(HDPA hdpa, PFNDPAENUMCALLBACK enumProc, LPVOID lParam)
Definition: dpa.c:1003

Referenced by CreateAbsolutePidlArray(), and GetUIObjectOf().

◆ GetAttributesOf()

STDMETHODIMP CFindFolder::GetAttributesOf ( UINT  cidl,
PCUITEMID_CHILD_ARRAY  apidl,
DWORD rgfInOut 
)
private

Definition at line 928 of file CFindFolder.cpp.

929{
930 if (!cidl)
931 {
932 *rgfInOut &= SFGAO_BROWSABLE; // TODO: SFGAO_CANRENAME?
933 return S_OK;
934 }
935
937 for (UINT i = 0; i < cidl; ++i)
938 {
939 CComPtr<IShellFolder> pFolder;
940 PCUITEMID_CHILD pidlChild;
941 if (FAILED_UNEXPECTEDLY(hr = GetFSFolderAndChild(apidl[i], &pFolder, &pidlChild)))
942 break;
943 if (FAILED(hr = pFolder->GetAttributesOf(1, &pidlChild, rgfInOut)))
944 break;
945 }
946 return hr;
947}
#define E_INVALIDARG
Definition: ddrawi.h:101
#define S_OK
Definition: intsafe.h:52
#define FAILED(hr)
Definition: intsafe.h:51

◆ GetClassID()

STDMETHODIMP CFindFolder::GetClassID ( CLSID pClassId)
private

Implements IPersist.

Definition at line 1253 of file CFindFolder.cpp.

1254{
1255 if (pClassId == NULL)
1256 return E_INVALIDARG;
1257 *pClassId = CLSID_FindFolder;
1258 return S_OK;
1259}

◆ GetCurFolder()

STDMETHODIMP CFindFolder::GetCurFolder ( PIDLIST_ABSOLUTE pidl)
private

Implements IPersistFolder2.

Definition at line 1233 of file CFindFolder.cpp.

1234{
1235 return SHILClone(m_pidl, pidl);
1236}
HRESULT SHILClone(_In_opt_ LPCITEMIDLIST pidl, _Outptr_ LPITEMIDLIST *ppidl)
Definition: utils.cpp:133

◆ GetDefaultColumn()

STDMETHODIMP CFindFolder::GetDefaultColumn ( DWORD  dwRes,
ULONG pSort,
ULONG pDisplay 
)
private

Implements IShellFolder2.

Definition at line 791 of file CFindFolder.cpp.

792{
793 if (pSort)
794 *pSort = COL_NAME_INDEX;
795 if (pDisplay)
796 *pDisplay = COL_NAME_INDEX;
797 return S_OK;
798}

◆ GetDefaultColumnState()

STDMETHODIMP CFindFolder::GetDefaultColumnState ( UINT  iColumn,
DWORD pcsFlags 
)
private

Implements IShellFolder2.

Definition at line 800 of file CFindFolder.cpp.

801{
802 if (!pcsFlags)
803 return E_INVALIDARG;
804 if (iColumn >= _countof(g_ColumnDefs))
805 return m_pisfInner->GetDefaultColumnState(iColumn - _countof(g_ColumnDefs) + 1, pcsFlags);
806 *pcsFlags = g_ColumnDefs[iColumn].dwDefaultState;
807 return S_OK;
808}
DWORD dwDefaultState
Definition: CFontExt.cpp:20

◆ GetDefaultSearchGUID()

STDMETHODIMP CFindFolder::GetDefaultSearchGUID ( GUID pguid)
private

Implements IShellFolder2.

Definition at line 779 of file CFindFolder.cpp.

780{
782 return E_NOTIMPL;
783}

◆ GetDetailsEx()

STDMETHODIMP CFindFolder::GetDetailsEx ( PCUITEMID_CHILD  pidl,
const SHCOLUMNID pscid,
VARIANT pv 
)
private

Implements IShellFolder2.

Definition at line 810 of file CFindFolder.cpp.

811{
812 // FIXME: Handle COL_LOCATION_INDEX and COL_RELEVANCE_INDEX
814 PCUITEMID_CHILD pChild;
815 if (SUCCEEDED(GetFSFolder2AndChild(pidl, &pFolder, &pChild)))
816 return pFolder->GetDetailsEx(pChild, pscid, pv);
817 return E_FAIL;
818}
HRESULT GetFSFolder2AndChild(LPCITEMIDLIST pidl, IShellFolder2 **ppSF, PCUITEMID_CHILD *ppidlLast=NULL)
#define E_FAIL
Definition: ddrawi.h:102
#define SUCCEEDED(hr)
Definition: intsafe.h:50

◆ GetDetailsOf()

STDMETHODIMP CFindFolder::GetDetailsOf ( PCUITEMID_CHILD  pidl,
UINT  iColumn,
SHELLDETAILS pDetails 
)
private

Implements IShellFolder2.

Definition at line 820 of file CFindFolder.cpp.

821{
822 if (iColumn >= _countof(g_ColumnDefs))
823 {
824 UINT FSColumn = iColumn - _countof(g_ColumnDefs) + 1;
825 if (pidl)
826 {
828 PCUITEMID_CHILD pChild;
829 if (SUCCEEDED(GetFSFolder2AndChild(pidl, &pFolder, &pChild)))
830 return pFolder->GetDetailsOf(pChild, FSColumn, pDetails);
831 }
832 return m_pisfInner->GetDetailsOf(pidl, FSColumn, pDetails); // Column header info
833 }
834
835 pDetails->cxChar = g_ColumnDefs[iColumn].cxChar;
836 pDetails->fmt = g_ColumnDefs[iColumn].fmt;
837 if (!pidl)
838 return SHSetStrRet(&pDetails->str, _AtlBaseModule.GetResourceInstance(), g_ColumnDefs[iColumn].iResource);
839
840 if (iColumn == COL_LOCATION_INDEX)
841 {
842 return SHSetStrRet(&pDetails->str, _ILGetPath(pidl));
843 }
844
845 if (iColumn == COL_RELEVANCE_INDEX)
846 {
847 // TODO: Fill once the relevance is calculated
848 return SHSetStrRetEmpty(&pDetails->str);
849 }
850
851 ATLASSERT(iColumn == COL_NAME_INDEX);
852 return GetDisplayNameOf(pidl, SHGDN_NORMAL | SHGDN_INFOLDER, &pDetails->str);
853}
#define ATLASSERT(x)
Definition: CComVariant.cpp:10
STDMETHODIMP GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET pName)
STRRET str
Definition: shtypes.idl:108

◆ GetDisplayNameOf()

STDMETHODIMP CFindFolder::GetDisplayNameOf ( PCUITEMID_CHILD  pidl,
DWORD  dwFlags,
LPSTRRET  pName 
)
private

Definition at line 1131 of file CFindFolder.cpp.

1132{
1133 HRESULT hr;
1134 CComPtr<IShellFolder> pFolder;
1135 PCUITEMID_CHILD pidlChild;
1136 if (FAILED_UNEXPECTEDLY(hr = GetFSFolderAndChild(pidl, &pFolder, &pidlChild)))
1137 return hr;
1138 return pFolder->GetDisplayNameOf(pidlChild, dwFlags, pName);
1139}
static LPSTR pName
Definition: security.c:75
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176

Referenced by GetDetailsOf().

◆ GetFSFolder2AndChild()

HRESULT CFindFolder::GetFSFolder2AndChild ( LPCITEMIDLIST  pidl,
IShellFolder2 **  ppSF,
PCUITEMID_CHILD ppidlLast = NULL 
)
private

Definition at line 231 of file CFindFolder.cpp.

232{
234 HRESULT hr = GetFSFolderAndChild(pidl, &pSF1, ppidlLast);
235 if (SUCCEEDED(hr))
236 hr = pSF1->QueryInterface(IID_PPV_ARG(IShellFolder2, ppSF));
237 return hr;
238}

Referenced by GetDetailsEx(), and GetDetailsOf().

◆ GetFSFolderAndChild()

HRESULT CFindFolder::GetFSFolderAndChild ( LPCITEMIDLIST  pidl,
IShellFolder **  ppSF,
PCUITEMID_CHILD ppidlLast = NULL 
)
private

Definition at line 215 of file CFindFolder.cpp.

216{
218 PCWSTR path = _ILGetPath(pidl);
219 if (!path || !path[0])
220 return E_INVALIDARG;
221 PIDLIST_ABSOLUTE pidlFolder = ILCreateFromPathW(path); // FIXME: SHELL32_CreateSimpleIDListFromPath(, DIRECTORY);
222 if (!pidlFolder)
223 return E_FAIL;
224 HRESULT hr = m_pSfDesktop->BindToObject(pidlFolder, NULL, IID_PPV_ARG(IShellFolder, ppSF));
225 ILFree(pidlFolder);
226 if (ppidlLast)
227 *ppidlLast = _ILGetFSPidl(pidl);
228 return hr;
229}
CComPtr< IShellFolder2 > m_pSfDesktop
Definition: CFindFolder.h:67
LPITEMIDLIST WINAPI ILCreateFromPathW(LPCWSTR path)
Definition: pidl.c:1102
const uint16_t * PCWSTR
Definition: typedefs.h:57

Referenced by BindToObject(), GetAttributesOf(), GetDisplayNameOf(), GetFSFolder2AndChild(), GetUIObjectOf(), and SetNameOf().

◆ GetUIObjectOf()

STDMETHODIMP CFindFolder::GetUIObjectOf ( HWND  hwndOwner,
UINT  cidl,
PCUITEMID_CHILD_ARRAY  apidl,
REFIID  riid,
UINT prgfInOut,
LPVOID ppvOut 
)
private

Definition at line 1073 of file CFindFolder.cpp.

1075{
1076 HRESULT hr;
1077 if (cidl <= 0)
1078 return E_INVALIDARG;
1079
1080 CComHeapPtr<PCITEMID_CHILD> aFSPidlAlloc;
1081 PCITEMID_CHILD pidlSingleBuffer, *aFSPidl = &pidlSingleBuffer; // Optimize for single item callers
1082 if (cidl != 1)
1083 {
1084 if (riid == IID_IDataObject)
1085 {
1086 if (HDPA hDpa = CreateAbsolutePidlArray(cidl, apidl))
1087 {
1089 ITEMIDLIST pidlRoot = {};
1091 NULL, (IDataObject**)ppvOut);
1092 FreePidlArray(hDpa);
1093 return hr;
1094 }
1095 }
1096
1097 aFSPidlAlloc.Allocate(cidl);
1098 aFSPidl = aFSPidlAlloc;
1099 }
1100 for (UINT i = 0; i < cidl; i++)
1101 {
1102 aFSPidl[i] = _ILGetFSPidl(apidl[i]);
1103 }
1104
1105 if (riid == IID_IContextMenu)
1106 {
1107 // FIXME: Use CDefFolderMenu_Create2(..., AddFSClassKeysToArray())
1109 if (!folderPidl)
1110 return E_OUTOFMEMORY;
1111 CComPtr<IShellFolder> pDesktopFolder;
1112 if (FAILED_UNEXPECTEDLY(hr = SHGetDesktopFolder(&pDesktopFolder)))
1113 return hr;
1114 CComPtr<IShellFolder> pShellFolder;
1115 hr = pDesktopFolder->BindToObject(folderPidl, NULL, IID_PPV_ARG(IShellFolder, &pShellFolder));
1117 return hr;
1118 CComPtr<IContextMenu> pContextMenu;
1119 hr = pShellFolder->GetUIObjectOf(hwndOwner, cidl, aFSPidl, riid, prgfInOut, (void**)&pContextMenu);
1121 return hr;
1122 return CFindFolderContextMenu::Create(m_shellFolderView, cidl, pContextMenu, (IContextMenu **)ppvOut);
1123 }
1124
1125 CComPtr<IShellFolder> pFolder;
1126 if (FAILED_UNEXPECTEDLY(hr = GetFSFolderAndChild(apidl[0], &pFolder)))
1127 return hr;
1128 return pFolder->GetUIObjectOf(hwndOwner, cidl, aFSPidl, riid, prgfInOut, ppvOut);
1129}
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
HRESULT WINAPI SHCreateFileDataObject(PCIDLIST_ABSOLUTE pidlFolder, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, IDataObject *pDataInner, IDataObject **ppDataObj)
static HRESULT Create(IShellFolderView *pShellFolderView, UINT cidl, IContextMenu *pInnerContextMenu, IContextMenu **pContextMenu)
static int CALLBACK SortItemsForDataObject(void *p1, void *p2, LPARAM lparam)
HDPA CreateAbsolutePidlArray(UINT cidl, PCUITEMID_CHILD_ARRAY apidl)
bool Allocate(_In_ size_t nElements=1)
Definition: atlalloc.h:143
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
BOOL WINAPI DPA_Sort(HDPA hdpa, PFNDPACOMPARE pfnCompare, LPARAM lParam)
Definition: dpa.c:813
const GUID IID_IDataObject
#define DPA_GetPtrPtr(hdpa)
Definition: commctrl.h:4974
const PCUITEMID_CHILD * PCUITEMID_CHILD_ARRAY
Definition: shtypes.idl:71

◆ Initialize()

STDMETHODIMP CFindFolder::Initialize ( PCIDLIST_ABSOLUTE  pidl)
private

Implements IPersistFolder.

Definition at line 1239 of file CFindFolder.cpp.

1240{
1241 if (m_pidl)
1242 return E_UNEXPECTED;
1243 HRESULT hr;
1245 return hr;
1246 if (FAILED(hr = SHILClone(pidl, &m_pidl)))
1247 return hr;
1248 return SHELL32_CoCreateInitSF(m_pidl, NULL, NULL, &CLSID_ShellFSFolder,
1250}
static HRESULT SHELL32_CoCreateInitSF(LPCITEMIDLIST pidlRoot, PERSIST_FOLDER_TARGET_INFO *ppfti, LPCITEMIDLIST pidlChild, const GUID *clsid, REFIID riid, LPVOID *ppvOut)
Definition: CFindFolder.cpp:39
#define E_UNEXPECTED
Definition: winerror.h:2456

◆ MapColumnToSCID()

STDMETHODIMP CFindFolder::MapColumnToSCID ( UINT  iColumn,
SHCOLUMNID pscid 
)
private

Implements IShellFolder2.

Definition at line 855 of file CFindFolder.cpp.

856{
858 return E_NOTIMPL;
859}

◆ MessageSFVCB()

STDMETHODIMP CFindFolder::MessageSFVCB ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
private

Definition at line 1175 of file CFindFolder.cpp.

1176{
1177 switch (uMsg)
1178 {
1179 case SFVM_DEFVIEWMODE:
1180 {
1181 FOLDERVIEWMODE *pViewMode = (FOLDERVIEWMODE *) lParam;
1182 *pViewMode = FVM_DETAILS;
1183 return S_OK;
1184 }
1185 case SFVM_WINDOWCREATED:
1186 {
1187 // Subclass window to receive window messages
1189
1190 // Get shell browser for updating status bar text
1193 return hr;
1194
1195 // Open search bar
1196 CComPtr<IWebBrowser2> pWebBrowser2;
1197 hr = m_shellBrowser->QueryInterface(IID_PPV_ARG(IWebBrowser2, &pWebBrowser2));
1199 return hr;
1200 WCHAR wszGuid[39];
1201 StringFromGUID2(CLSID_FileSearchBand, wszGuid, _countof(wszGuid));
1202 CComVariant searchBar(wszGuid);
1203 return pWebBrowser2->ShowBrowserBar(&searchBar, NULL, NULL);
1204 }
1205 case SFVM_WINDOWCLOSING:
1206 {
1209 return S_OK;
1210 }
1211 case SFVM_GETCOMMANDDIR:
1212 {
1213 HRESULT hr = E_FAIL;
1215 {
1216 PCUITEMID_CHILD *apidl;
1217 UINT cidl = 0;
1218 if (SUCCEEDED(hr = m_shellFolderView->GetSelectedObjects(&apidl, &cidl)))
1219 {
1220 if (cidl)
1222 LocalFree(apidl);
1223 }
1224 }
1225 return hr;
1226 }
1227 // TODO: SFVM_GETCOLUMNSTREAM
1228 }
1229 return E_NOTIMPL;
1230}
#define SFVM_GETCOMMANDDIR
#define SFVM_WINDOWCLOSING
CComPtr< IShellBrowser > m_shellBrowser
Definition: CFindFolder.h:69
WPARAM wParam
Definition: combotst.c:138
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2434
HRESULT WINAPI IUnknown_QueryService(IUnknown *, REFGUID, REFIID, LPVOID *)
Definition: ordinal.c:1501
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594
#define SID_SShellBrowser
Definition: shlguid.h:128
#define SFVM_DEFVIEWMODE
Definition: shlobj.h:1323
#define SFVM_WINDOWCREATED
Definition: shlobj.h:1313
FOLDERVIEWMODE
Definition: shobjidl.idl:677
@ FVM_DETAILS
Definition: shobjidl.idl:683
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
uint16_t * PWSTR
Definition: typedefs.h:56
#define SubclassWindow(hwnd, lpfn)
Definition: windowsx.h:542
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ NotifyConnections()

void CFindFolder::NotifyConnections ( DISPID  id)
private

Definition at line 624 of file CFindFolder.cpp.

625{
626 DISPPARAMS dispatchParams = {0};
627 CComDynamicUnkArray &subscribers =
629 for (IUnknown** pSubscriber = subscribers.begin(); pSubscriber < subscribers.end(); pSubscriber++)
630 {
631 if (!*pSubscriber)
632 continue;
633
634 CComPtr<IDispatch> pDispatch;
635 HRESULT hResult = (*pSubscriber)->QueryInterface(IID_PPV_ARG(IDispatch, &pDispatch));
636 if (!FAILED_UNEXPECTEDLY(hResult))
637 pDispatch->Invoke(id, GUID_NULL, 0, DISPATCH_METHOD, &dispatchParams, NULL, NULL, NULL);
638 }
639}
IUnknown ** end()
Definition: atlcom.h:1128
IUnknown ** begin()
Definition: atlcom.h:1123
#define GUID_NULL
Definition: ks.h:106
struct stdole::DISPPARAMS DISPPARAMS
#define DISPATCH_METHOD
Definition: oleauto.h:1006

◆ ParseDisplayName()

STDMETHODIMP CFindFolder::ParseDisplayName ( HWND  hwndOwner,
LPBC  pbc,
LPOLESTR  lpszDisplayName,
ULONG pchEaten,
PIDLIST_RELATIVE ppidl,
ULONG pdwAttributes 
)
private

Implements IShellFolder.

Definition at line 862 of file CFindFolder.cpp.

864{
866 return E_NOTIMPL;
867}

◆ SearchThreadProc()

DWORD WINAPI CFindFolder::SearchThreadProc ( LPVOID  lpParameter)
staticprivate

Definition at line 590 of file CFindFolder.cpp.

591{
592 _SearchData *data = static_cast<_SearchData*>(lpParameter);
593
595
597
598 data->pFindFolder->NotifyConnections(DISPID_SEARCHSTART);
599
600 UINT uTotalFound = 0;
601 for (LOCATIONITEM *pLocation = data->pPaths; pLocation; pLocation = pLocation->pNext)
602 {
603 uTotalFound += RecursiveFind(pLocation->szPath, data);
604 }
605
606 data->pFindFolder->NotifyConnections(DISPID_SEARCHCOMPLETE);
607
609 status.Format(IDS_SEARCH_FILES_FOUND, uTotalFound);
610 LPWSTR pszStatusDup;
611 SHStrDupW(status.GetBuffer(), &pszStatusDup);
612 ::PostMessageW(data->hwnd, WM_SEARCH_UPDATE_STATUS, 0, (LPARAM)pszStatusDup);
613 ::SendMessageW(data->hwnd, WM_SEARCH_STOP, 0, 0);
614
615 CloseHandle(data->hStopEvent);
616 delete data;
617
618 if (SUCCEEDED(hrCoInit))
620
621 return 0;
622}
static UINT RecursiveFind(LPCWSTR lpPath, _SearchData *pSearchData)
#define IDS_SEARCH_FILES_FOUND
Definition: resource.h:178
#define CloseHandle
Definition: compat.h:739
BOOL WINAPI SetThreadPriority(IN HANDLE hThread, IN int nPriority)
Definition: thread.c:700
HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit)
Definition: compobj.c:2002
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
HRESULT WINAPI SHStrDupW(LPCWSTR src, LPWSTR *dest)
Definition: string.c:2018
#define DISPID_SEARCHSTART
Definition: exdispid.h:172
#define DISPID_SEARCHCOMPLETE
Definition: exdispid.h:173
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
@ COINIT_MULTITHREADED
Definition: objbase.h:279
#define WM_SEARCH_UPDATE_STATUS
Definition: shellfind.h:32
#define WM_SEARCH_STOP
Definition: shellfind.h:30
Definition: ps.c:97
struct tagLOCATIONITEM * pNext
Definition: shellfind.h:36
HANDLE WINAPI GetCurrentThread(void)
Definition: proc.c:1148
#define THREAD_PRIORITY_BELOW_NORMAL
Definition: winbase.h:309
LONG_PTR LPARAM
Definition: windef.h:208
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by StartSearch().

◆ SetNameOf()

STDMETHODIMP CFindFolder::SetNameOf ( HWND  hwndOwner,
PCUITEMID_CHILD  pidl,
LPCOLESTR  lpName,
DWORD  dwFlags,
PITEMID_CHILD pPidlOut 
)
private

Implements IShellFolder.

Definition at line 1141 of file CFindFolder.cpp.

1143{
1144 if (!pPidlOut)
1145 return E_INVALIDARG; // Our pidls are special, the caller must get it from us and not from parsing
1146 *pPidlOut = NULL;
1147
1148 HRESULT hr;
1149 CComPtr<IShellFolder> pFolder;
1150 PCUITEMID_CHILD pidlChild;
1151 if (FAILED_UNEXPECTEDLY(hr = GetFSFolderAndChild(pidl, &pFolder, &pidlChild)))
1152 return hr;
1153
1154 PCWSTR pszDir = _ILGetPath(pidl);
1155 PWSTR pszFull = (PWSTR)SHAlloc((wcslen(pszDir) + MAX_PATH) * sizeof(*pszDir));
1156 if (!pszFull)
1157 return E_OUTOFMEMORY;
1158
1159 PITEMID_CHILD pidlRawNew = NULL;
1160 hr = pFolder->SetNameOf(hwndOwner, pidlChild, lpName, dwFlags, &pidlRawNew);
1161 if (SUCCEEDED(hr) && pidlRawNew)
1162 {
1163 WCHAR szFileName[MAX_PATH];
1164 hr = DisplayNameOfW(pFolder, pidlRawNew, SHGDN_FORPARSING | SHGDN_INFOLDER, szFileName, _countof(szFileName));
1165 ILFree(pidlRawNew);
1166 PathCombineW(pszFull, pszDir, szFileName);
1167 if (SUCCEEDED(hr))
1168 hr = ((*pPidlOut = _ILCreate(pszFull)) != NULL) ? S_OK : E_OUTOFMEMORY;
1169 }
1170 SHFree(pszFull);
1171 return hr;
1172}
static HRESULT WINAPI DisplayNameOfW(_In_ IShellFolder *psf, _In_ LPCITEMIDLIST pidl, _In_ DWORD dwFlags, _Out_ LPWSTR pszBuf, _In_ UINT cchBuf)
Definition: CFindFolder.cpp:15
#define MAX_PATH
Definition: compat.h:34
void WINAPI SHFree(LPVOID pv)
Definition: shellole.c:337
LPVOID WINAPI SHAlloc(SIZE_T len)
Definition: shellole.c:315
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define PathCombineW
Definition: pathcch.h:318
_In_ LPCSTR pszDir
Definition: shellapi.h:601
_In_ LPCSTR lpName
Definition: winbase.h:2830

◆ SortItemsForDataObject()

int CALLBACK CFindFolder::SortItemsForDataObject ( void p1,
void p2,
LPARAM  lparam 
)
staticprivate

Definition at line 1067 of file CFindFolder.cpp.

1068{
1069 // For Delete/Move operations, a subfolder/file needs to come before the parent folder
1070 return ::ILGetSize((LPCITEMIDLIST)p1) - ::ILGetSize((LPCITEMIDLIST)p2);
1071}
#define ILGetSize
Definition: shellclasses.h:638
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42

Referenced by GetUIObjectOf().

◆ StartSearch()

LRESULT CFindFolder::StartSearch ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
private

Definition at line 641 of file CFindFolder.cpp.

642{
643 HKEY hkey;
644 DWORD size = sizeof(DWORD);
646 DWORD SearchHiddenValue = 0;
647
648 if (!lParam)
649 return 0;
650
651 // Clear all previous search results
652 UINT uItemIndex;
653 m_shellFolderView->RemoveObject(NULL, &uItemIndex);
654
655 _SearchData* pSearchData = new _SearchData();
656 pSearchData->pFindFolder = this;
657 pSearchData->hwnd = m_hWnd;
658
659 SearchStart *pSearchParams = (SearchStart *) lParam;
660 pSearchData->pPaths = pSearchParams->pPaths;
661 pSearchData->szFileName = pSearchParams->szFileName;
662 pSearchData->szQueryA = pSearchParams->szQuery;
663 pSearchData->szQueryW = pSearchParams->szQuery;
664
665 // UTF-16 BE
666 {
667 CStringW utf16 = pSearchData->szQueryW;
668 LPWSTR psz = utf16.GetBuffer();
669 for (SIZE_T i = 0; psz[i]; ++i)
670 {
671 psz[i] = MAKEWORD(HIBYTE(psz[i]), LOBYTE(psz[i]));
672 }
673 utf16.ReleaseBuffer();
674 pSearchData->szQueryU16BE = utf16;
675 }
676
677 // UTF-8
678 {
680 INT cch = WideCharToMultiByte(CP_UTF8, 0, pSearchData->szQueryW, -1, NULL, 0, NULL, NULL);
681 if (cch > 0)
682 {
683 LPSTR psz = utf8.GetBuffer(cch);
684 WideCharToMultiByte(CP_UTF8, 0, pSearchData->szQueryW, -1, psz, cch, NULL, NULL);
685 utf8.ReleaseBuffer();
686 pSearchData->szQueryU8 = utf8;
687 }
688 else
689 {
690 pSearchData->szQueryU8 = pSearchData->szQueryA;
691 }
692 }
693
694 pSearchData->SearchHidden = pSearchParams->SearchHidden;
695 SHFree(pSearchParams);
696
697 TRACE("pSearchParams->SearchHidden is '%d'.\n", pSearchData->SearchHidden);
698
699 if (pSearchData->SearchHidden)
700 SearchHiddenValue = 1;
701 else
702 SearchHiddenValue = 0;
703
704 /* Placing the code to save the changed settings to the registry here has the effect of not saving any changes */
705 /* to the registry unless the user clicks on the "Search" button. This is the same as what we see in Windows. */
706 result = RegOpenKeyEx(HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer", 0, KEY_SET_VALUE, &hkey);
707 if (result == ERROR_SUCCESS)
708 {
709 if (RegSetValueExW(hkey, L"SearchHidden", NULL, REG_DWORD, (const BYTE*)&SearchHiddenValue, size) == ERROR_SUCCESS)
710 {
711 TRACE("SearchHidden is '%d'.\n", SearchHiddenValue);
712 }
713 else
714 {
715 ERR("RegSetValueEx for \"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\SearchHidden\" Failed.\n");
716 }
717 RegCloseKey(hkey);
718 }
719 else
720 {
721 ERR("RegOpenKey for \"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\" Failed.\n");
722 }
723
724 if (m_hStopEvent)
727
728 if (!SHCreateThread(SearchThreadProc, pSearchData, 0, NULL))
729 {
730 if (pSearchData->hStopEvent)
731 {
732 CloseHandle(pSearchData->hStopEvent);
734 }
735 delete pSearchData;
736 }
737 return 0;
738}
#define ERR(fmt,...)
Definition: precomp.h:57
#define RegCloseKey(hKey)
Definition: registry.h:49
void ReleaseBuffer(_In_ int nNewLength=-1)
Definition: atlsimpstr.h:387
HWND m_hWnd
Definition: atlwin.h:273
static DWORD WINAPI SearchThreadProc(LPVOID lpParameter)
#define ERROR_SUCCESS
Definition: deptool.c:10
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4882
#define WideCharToMultiByte
Definition: compat.h:111
BOOL WINAPI SHCreateThread(LPTHREAD_START_ROUTINE pfnThreadProc, VOID *pData, DWORD dwFlags, LPTHREAD_START_ROUTINE pfnCallback)
Definition: thread.c:356
#define L(x)
Definition: resources.c:13
unsigned long DWORD
Definition: ntddk_ex.h:95
GLsizeiptr size
Definition: glext.h:5919
GLuint64EXT * result
Definition: glext.h:11304
#define LOBYTE(W)
Definition: jmemdos.c:487
#define HIBYTE(W)
Definition: jmemdos.c:486
static DWORD DWORD void LPSTR DWORD cch
Definition: str.c:202
#define DWORD
Definition: nt_native.h:44
#define KEY_SET_VALUE
Definition: nt_native.h:1017
#define REG_DWORD
Definition: sdbapi.c:596
#define CP_UTF8
Definition: nls.h:20
#define TRACE(s)
Definition: solgame.cpp:4
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
CStringA szQueryA
CStringW szQueryW
CStringW szFileName
CStringW szQueryU16BE
LOCATIONITEM * pPaths
HANDLE hStopEvent
CStringA szQueryU8
CComPtr< CFindFolder > pFindFolder
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
#define MAKEWORD(a, b)
Definition: typedefs.h:248
ULONG_PTR SIZE_T
Definition: typedefs.h:80
int32_t INT
Definition: typedefs.h:58
#define CreateEvent
Definition: winbase.h:3789
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define RegOpenKeyEx
Definition: winreg.h:520
char * LPSTR
Definition: xmlstorage.h:182
unsigned char BYTE
Definition: xxhash.c:193

◆ StopSearch()

LRESULT CFindFolder::StopSearch ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
private

Definition at line 740 of file CFindFolder.cpp.

741{
742 if (m_hStopEvent)
743 {
746 }
747 return 0;
748}

◆ UpdateStatus()

LRESULT CFindFolder::UpdateStatus ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
private

Definition at line 767 of file CFindFolder.cpp.

768{
770 if (m_shellBrowser)
771 {
772 m_shellBrowser->SetStatusTextSB(status);
773 }
774
775 return 0;
776}

Member Data Documentation

◆ m_hStopEvent

HANDLE CFindFolder::m_hStopEvent
private

Definition at line 70 of file CFindFolder.h.

Referenced by StartSearch(), and StopSearch().

◆ m_pidl

LPITEMIDLIST CFindFolder::m_pidl
private

Definition at line 66 of file CFindFolder.h.

Referenced by GetCurFolder(), and Initialize().

◆ m_pisfInner

CComPtr<IShellFolder2> CFindFolder::m_pisfInner
private

Definition at line 67 of file CFindFolder.h.

Referenced by CompareIDs(), GetDefaultColumnState(), GetDetailsOf(), and Initialize().

◆ m_pSfDesktop

CComPtr<IShellFolder2> CFindFolder::m_pSfDesktop
private

Definition at line 67 of file CFindFolder.h.

Referenced by GetFSFolderAndChild(), and Initialize().

◆ m_shellBrowser

CComPtr<IShellBrowser> CFindFolder::m_shellBrowser
private

Definition at line 69 of file CFindFolder.h.

Referenced by MessageSFVCB(), and UpdateStatus().

◆ m_shellFolderView

CComPtr<IShellFolderView> CFindFolder::m_shellFolderView
private

Definition at line 68 of file CFindFolder.h.

Referenced by AddResult(), CreateViewObject(), GetUIObjectOf(), MessageSFVCB(), and StartSearch().


The documentation for this class was generated from the following files: