ReactOS 0.4.15-dev-7918-g2a2556c
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)
 
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 DWORD WINAPI SearchThreadProc (LPVOID lpParameter)
 

Private Attributes

LPITEMIDLIST m_pidl
 
CComPtr< IShellFolder2m_pisfInner
 
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 94 of file CFindFolder.cpp.

94 :
96{
97}
HANDLE m_hStopEvent
Definition: CFindFolder.h:70
#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 603 of file CFindFolder.cpp.

604{
605 if (!lParam)
606 return 0;
607
609
610 CComHeapPtr<ITEMIDLIST> lpSearchPidl(_ILCreate(lpPath));
611 if (lpSearchPidl)
612 {
613 UINT uItemIndex;
614 m_shellFolderView->AddObject(lpSearchPidl, &uItemIndex);
615 }
616
617 return 0;
618}
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 713 of file CFindFolder.cpp.

714{
716 return E_NOTIMPL;
717}
#define UNIMPLEMENTED
Definition: debug.h:115
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ BindToStorage()

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

Definition at line 719 of file CFindFolder.cpp.

720{
722 return E_NOTIMPL;
723}

◆ CompareIDs()

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

Implements IShellFolder.

Definition at line 725 of file CFindFolder.cpp.

726{
727 WORD wColumn = LOWORD(lParam);
728 switch (wColumn)
729 {
730 case COL_NAME_INDEX: // Name
731 break;
732 case COL_LOCATION_INDEX: // Path
733 return MAKE_COMPARE_HRESULT(StrCmpW(_ILGetPath(pidl1), _ILGetPath(pidl2)));
734 case COL_RELEVANCE_INDEX: // Relevance
735 return E_NOTIMPL;
736 default: // Default columns
737 wColumn -= _countof(g_ColumnDefs) - 1;
738 break;
739 }
740 return m_pisfInner->CompareIDs(HIWORD(lParam) | wColumn, _ILGetFSPidl(pidl1), _ILGetFSPidl(pidl2));
741}
static LPCWSTR _ILGetPath(LPCITEMIDLIST pidl)
static LPCITEMIDLIST _ILGetFSPidl(LPCITEMIDLIST pidl)
static FolderViewColumns g_ColumnDefs[]
Definition: CFontExt.cpp:35
CComPtr< IShellFolder2 > m_pisfInner
Definition: CFindFolder.h:67
#define COL_NAME_INDEX
Definition: resource.h:185
#define COL_RELEVANCE_INDEX
Definition: resource.h:187
#define COL_LOCATION_INDEX
Definition: resource.h:186
int WINAPI StrCmpW(LPCWSTR lpszStr, LPCWSTR lpszComp)
Definition: string.c:434
unsigned short WORD
Definition: ntddk_ex.h:93
#define LOWORD(l)
Definition: pedump.c:82
#define MAKE_COMPARE_HRESULT(x)
Definition: shellutils.h:579
#define _countof(array)
Definition: sndvol32.h:68
#define HIWORD(l)
Definition: typedefs.h:247

◆ CreateViewObject()

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

Definition at line 743 of file CFindFolder.cpp.

744{
745 if (riid == IID_IShellView)
746 {
747 SFV_CREATE sfvparams = {};
748 sfvparams.cbSize = sizeof(SFV_CREATE);
749 sfvparams.pshf = this;
750 sfvparams.psfvcb = this;
751 HRESULT hr = SHCreateShellFolderView(&sfvparams, (IShellView **) ppvOut);
753 {
754 return hr;
755 }
756
757 return ((IShellView * ) * ppvOut)->QueryInterface(IID_PPV_ARG(IShellFolderView, &m_shellFolderView));
758 }
759 return E_NOINTERFACE;
760}
HRESULT WINAPI SHCreateShellFolderView(const SFV_CREATE *pcsfv, IShellView **ppsv)
Definition: CDefView.cpp:3855
#define FAILED_UNEXPECTEDLY(hr)
Definition: precomp.h:121
REFIID riid
Definition: atlbase.h:39
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
HRESULT hr
Definition: shlfolder.c:183
struct _SFV_CREATE SFV_CREATE
IShellFolderViewCB * psfvcb
Definition: shlobj.h:1351
UINT cbSize
Definition: shlobj.h:1348
IShellFolder * pshf
Definition: shlobj.h:1349
#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 707 of file CFindFolder.cpp.

708{
709 *ppEnumIDList = NULL;
710 return S_FALSE;
711}
#define S_FALSE
Definition: winerror.h:2357

◆ EnumSearches()

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

Implements IShellFolder2.

Definition at line 638 of file CFindFolder.cpp.

639{
641 return E_NOTIMPL;
642}

◆ GetAttributesOf()

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

Definition at line 762 of file CFindFolder.cpp.

763{
765 aFSPidl.Allocate(cidl);
766 for (UINT i = 0; i < cidl; i++)
767 {
768 aFSPidl[i] = _ILGetFSPidl(apidl[i]);
769 }
770
771 return m_pisfInner->GetAttributesOf(cidl, aFSPidl, rgfInOut);
772}
bool Allocate(_In_ size_t nElements=1)
Definition: atlalloc.h:143
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

◆ GetClassID()

STDMETHODIMP CFindFolder::GetClassID ( CLSID pClassId)
private

Implements IPersist.

Definition at line 958 of file CFindFolder.cpp.

959{
960 if (pClassId == NULL)
961 return E_INVALIDARG;
962 *pClassId = CLSID_FindFolder;
963 return S_OK;
964}
#define E_INVALIDARG
Definition: ddrawi.h:101
#define S_OK
Definition: intsafe.h:52

◆ GetCurFolder()

STDMETHODIMP CFindFolder::GetCurFolder ( PIDLIST_ABSOLUTE pidl)
private

Implements IPersistFolder2.

Definition at line 937 of file CFindFolder.cpp.

938{
939 *pidl = ILClone(m_pidl);
940 return S_OK;
941}
LPITEMIDLIST m_pidl
Definition: CFindFolder.h:66
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:237

◆ GetDefaultColumn()

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

Implements IShellFolder2.

Definition at line 644 of file CFindFolder.cpp.

645{
646 if (pSort)
647 *pSort = 0;
648 if (pDisplay)
649 *pDisplay = 0;
650 return S_OK;
651}

◆ GetDefaultColumnState()

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

Implements IShellFolder2.

Definition at line 653 of file CFindFolder.cpp.

654{
655 if (!pcsFlags)
656 return E_INVALIDARG;
657 if (iColumn >= _countof(g_ColumnDefs))
658 return m_pisfInner->GetDefaultColumnState(iColumn - _countof(g_ColumnDefs) + 1, pcsFlags);
659 *pcsFlags = g_ColumnDefs[iColumn].dwDefaultState;
660 return S_OK;
661}
DWORD dwDefaultState
Definition: CFontExt.cpp:21

◆ GetDefaultSearchGUID()

STDMETHODIMP CFindFolder::GetDefaultSearchGUID ( GUID pguid)
private

Implements IShellFolder2.

Definition at line 632 of file CFindFolder.cpp.

633{
635 return E_NOTIMPL;
636}

◆ GetDetailsEx()

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

Implements IShellFolder2.

Definition at line 663 of file CFindFolder.cpp.

664{
665 return m_pisfInner->GetDetailsEx(pidl, pscid, pv);
666}

◆ GetDetailsOf()

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

Implements IShellFolder2.

Definition at line 668 of file CFindFolder.cpp.

669{
670 if (iColumn >= _countof(g_ColumnDefs))
671 return m_pisfInner->GetDetailsOf(_ILGetFSPidl(pidl), iColumn - _countof(g_ColumnDefs) + 1, pDetails);
672
673 pDetails->cxChar = g_ColumnDefs[iColumn].cxChar;
674 pDetails->fmt = g_ColumnDefs[iColumn].fmt;
675
676 if (!pidl)
677 return SHSetStrRet(&pDetails->str, _AtlBaseModule.GetResourceInstance(), g_ColumnDefs[iColumn].iResource);
678
679 if (iColumn == COL_LOCATION_INDEX)
680 {
681 return SHSetStrRet(&pDetails->str, _ILGetPath(pidl));
682 }
683
684 if (iColumn == COL_RELEVANCE_INDEX)
685 {
686 // TODO: Fill once the relevance is calculated
687 return SHSetStrRet(&pDetails->str, "");
688 }
689
690 return GetDisplayNameOf(pidl, SHGDN_NORMAL, &pDetails->str);
691}
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 885 of file CFindFolder.cpp.

886{
887 return m_pisfInner->GetDisplayNameOf(_ILGetFSPidl(pidl), dwFlags, pName);
888}
static LPSTR pName
Definition: security.c:75
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176

Referenced by GetDetailsOf().

◆ GetUIObjectOf()

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

Definition at line 847 of file CFindFolder.cpp.

849{
850 if (cidl <= 0)
851 {
852 return m_pisfInner->GetUIObjectOf(hwndOwner, cidl, apidl, riid, prgfInOut, ppvOut);
853 }
854
856 aFSPidl.Allocate(cidl);
857 for (UINT i = 0; i < cidl; i++)
858 {
859 aFSPidl[i] = _ILGetFSPidl(apidl[i]);
860 }
861
862 if (riid == IID_IContextMenu)
863 {
865 if (!folderPidl)
866 return E_OUTOFMEMORY;
867 CComPtr<IShellFolder> pDesktopFolder;
868 HRESULT hResult = SHGetDesktopFolder(&pDesktopFolder);
869 if (FAILED_UNEXPECTEDLY(hResult))
870 return hResult;
871 CComPtr<IShellFolder> pShellFolder;
872 hResult = pDesktopFolder->BindToObject(folderPidl, NULL, IID_PPV_ARG(IShellFolder, &pShellFolder));
873 if (FAILED_UNEXPECTEDLY(hResult))
874 return hResult;
875 CComPtr<IContextMenu> pContextMenu;
876 hResult = pShellFolder->GetUIObjectOf(hwndOwner, cidl, aFSPidl, riid, prgfInOut, (LPVOID *)&pContextMenu);
877 if (FAILED_UNEXPECTEDLY(hResult))
878 return hResult;
879 return CFindFolderContextMenu::Create(m_shellFolderView, pContextMenu, (IContextMenu **)ppvOut);
880 }
881
882 return m_pisfInner->GetUIObjectOf(hwndOwner, cidl, aFSPidl, riid, prgfInOut, ppvOut);
883}
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
static HRESULT Create(IShellFolderView *pShellFolderView, IContextMenu *pInnerContextMenu, IContextMenu **pContextMenu)
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
LPITEMIDLIST WINAPI ILCreateFromPathW(LPCWSTR path)
Definition: pidl.c:995

◆ Initialize()

STDMETHODIMP CFindFolder::Initialize ( PCIDLIST_ABSOLUTE  pidl)
private

Implements IPersistFolder.

Definition at line 944 of file CFindFolder.cpp.

945{
946 m_pidl = ILClone(pidl);
947 if (!m_pidl)
948 return E_OUTOFMEMORY;
949
951 NULL,
952 NULL,
953 &CLSID_ShellFSFolder,
955}
static HRESULT SHELL32_CoCreateInitSF(LPCITEMIDLIST pidlRoot, PERSIST_FOLDER_TARGET_INFO *ppfti, LPCITEMIDLIST pidlChild, const GUID *clsid, REFIID riid, LPVOID *ppvOut)
Definition: CFindFolder.cpp:13

◆ MapColumnToSCID()

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

Implements IShellFolder2.

Definition at line 693 of file CFindFolder.cpp.

694{
696 return E_NOTIMPL;
697}

◆ MessageSFVCB()

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

Definition at line 898 of file CFindFolder.cpp.

899{
900 switch (uMsg)
901 {
902 case SFVM_DEFVIEWMODE:
903 {
904 FOLDERVIEWMODE *pViewMode = (FOLDERVIEWMODE *) lParam;
905 *pViewMode = FVM_DETAILS;
906 return S_OK;
907 }
909 {
910 // Subclass window to receive window messages
912
913 // Get shell browser for updating status bar text
914 CComPtr<IServiceProvider> pServiceProvider;
915 HRESULT hr = m_shellFolderView->QueryInterface(IID_PPV_ARG(IServiceProvider, &pServiceProvider));
917 return hr;
918 hr = pServiceProvider->QueryService(SID_SShellBrowser, IID_PPV_ARG(IShellBrowser, &m_shellBrowser));
920 return hr;
921
922 // Open search bar
923 CComPtr<IWebBrowser2> pWebBrowser2;
924 hr = m_shellBrowser->QueryInterface(IID_PPV_ARG(IWebBrowser2, &pWebBrowser2));
926 return hr;
927 WCHAR pwszGuid[MAX_PATH];
928 StringFromGUID2(CLSID_FileSearchBand, pwszGuid, _countof(pwszGuid));
929 CComVariant searchBar(pwszGuid);
930 return pWebBrowser2->ShowBrowserBar(&searchBar, NULL, NULL);
931 }
932 }
933 return E_NOTIMPL;
934}
CComPtr< IShellBrowser > m_shellBrowser
Definition: CFindFolder.h:69
WPARAM wParam
Definition: combotst.c:138
#define MAX_PATH
Definition: compat.h:34
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2434
#define SID_SShellBrowser
Definition: shlguid.h:128
#define SFVM_DEFVIEWMODE
Definition: shlobj.h:1311
#define SFVM_WINDOWCREATED
Definition: shlobj.h:1301
FOLDERVIEWMODE
Definition: shobjidl.idl:672
@ FVM_DETAILS
Definition: shobjidl.idl:678
#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 480 of file CFindFolder.cpp.

481{
482 DISPPARAMS dispatchParams = {0};
483 CComDynamicUnkArray &subscribers =
485 for (IUnknown** pSubscriber = subscribers.begin(); pSubscriber < subscribers.end(); pSubscriber++)
486 {
487 if (!*pSubscriber)
488 continue;
489
490 CComPtr<IDispatch> pDispatch;
491 HRESULT hResult = (*pSubscriber)->QueryInterface(IID_PPV_ARG(IDispatch, &pDispatch));
492 if (!FAILED_UNEXPECTEDLY(hResult))
493 pDispatch->Invoke(id, GUID_NULL, 0, DISPATCH_METHOD, &dispatchParams, NULL, NULL, NULL);
494 }
495}
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 700 of file CFindFolder.cpp.

702{
704 return E_NOTIMPL;
705}

◆ SearchThreadProc()

DWORD WINAPI CFindFolder::SearchThreadProc ( LPVOID  lpParameter)
staticprivate

Definition at line 454 of file CFindFolder.cpp.

455{
456 _SearchData *data = static_cast<_SearchData*>(lpParameter);
457
459
460 data->pFindFolder->NotifyConnections(DISPID_SEARCHSTART);
461
462 UINT uTotalFound = RecursiveFind(data->szPath, data);
463
464 data->pFindFolder->NotifyConnections(DISPID_SEARCHCOMPLETE);
465
467 status.Format(IDS_SEARCH_FILES_FOUND, uTotalFound);
469 ::SendMessageW(data->hwnd, WM_SEARCH_STOP, 0, 0);
470
471 CloseHandle(data->hStopEvent);
472 delete data;
473
474 if (SUCCEEDED(hrCoInit))
476
477 return 0;
478}
static UINT RecursiveFind(LPCWSTR lpPath, _SearchData *pSearchData)
#define IDS_SEARCH_FILES_FOUND
Definition: resource.h:176
#define CloseHandle
Definition: compat.h:739
HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit)
Definition: compobj.c:2002
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
LPWSTR WINAPI StrDupW(LPCWSTR lpszStr)
Definition: string.c:1093
#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
#define SUCCEEDED(hr)
Definition: intsafe.h:50
@ 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
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 890 of file CFindFolder.cpp.

892{
894 return E_NOTIMPL;
895}

◆ StartSearch()

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

Definition at line 497 of file CFindFolder.cpp.

498{
499 HKEY hkey;
500 DWORD size = sizeof(DWORD);
502 DWORD SearchHiddenValue = 0;
503
504 if (!lParam)
505 return 0;
506
507 // Clear all previous search results
508 UINT uItemIndex;
509 m_shellFolderView->RemoveObject(NULL, &uItemIndex);
510
511 _SearchData* pSearchData = new _SearchData();
512 pSearchData->pFindFolder = this;
513 pSearchData->hwnd = m_hWnd;
514
515 SearchStart *pSearchParams = (SearchStart *) lParam;
516 pSearchData->szPath = pSearchParams->szPath;
517 pSearchData->szFileName = pSearchParams->szFileName;
518 pSearchData->szQueryA = pSearchParams->szQuery;
519 pSearchData->szQueryW = pSearchParams->szQuery;
520
521 // UTF-16 BE
522 {
523 CStringW utf16 = pSearchData->szQueryW;
524 LPWSTR psz = utf16.GetBuffer();
525 for (SIZE_T i = 0; psz[i]; ++i)
526 {
527 psz[i] = MAKEWORD(HIBYTE(psz[i]), LOBYTE(psz[i]));
528 }
529 utf16.ReleaseBuffer();
530 pSearchData->szQueryU16BE = utf16;
531 }
532
533 // UTF-8
534 {
535 CStringA utf8;
536 INT cch = WideCharToMultiByte(CP_UTF8, 0, pSearchData->szQueryW, -1, NULL, 0, NULL, NULL);
537 if (cch > 0)
538 {
539 LPSTR psz = utf8.GetBuffer(cch);
540 WideCharToMultiByte(CP_UTF8, 0, pSearchData->szQueryW, -1, psz, cch, NULL, NULL);
541 utf8.ReleaseBuffer();
542 pSearchData->szQueryU8 = utf8;
543 }
544 else
545 {
546 pSearchData->szQueryU8 = pSearchData->szQueryA;
547 }
548 }
549
550 pSearchData->SearchHidden = pSearchParams->SearchHidden;
551 SHFree(pSearchParams);
552
553 TRACE("pSearchParams->SearchHidden is '%d'.\n", pSearchData->SearchHidden);
554
555 if (pSearchData->SearchHidden)
556 SearchHiddenValue = 1;
557 else
558 SearchHiddenValue = 0;
559
560 /* Placing the code to save the changed settings to the registry here has the effect of not saving any changes */
561 /* to the registry unless the user clicks on the "Search" button. This is the same as what we see in Windows. */
562 result = RegOpenKeyEx(HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer", 0, KEY_SET_VALUE, &hkey);
563 if (result == ERROR_SUCCESS)
564 {
565 if (RegSetValueExW(hkey, L"SearchHidden", NULL, REG_DWORD, (const BYTE*)&SearchHiddenValue, size) == ERROR_SUCCESS)
566 {
567 TRACE("SearchHidden is '%d'.\n", SearchHiddenValue);
568 }
569 else
570 {
571 ERR("RegSetValueEx for \"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\SearchHidden\" Failed.\n");
572 }
573 RegCloseKey(hkey);
574 }
575 else
576 {
577 ERR("RegOpenKey for \"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\" Failed.\n");
578 }
579
580 if (m_hStopEvent)
583
584 if (!SHCreateThread(SearchThreadProc, pSearchData, NULL, NULL))
585 {
586 SHFree(pSearchData);
587 return 0;
588 }
589
590 return 0;
591}
#define ERR(fmt,...)
Definition: debug.h:110
#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
void WINAPI SHFree(LPVOID pv)
Definition: shellole.c:326
BOOL WINAPI SHCreateThread(LPTHREAD_START_ROUTINE pfnThreadProc, VOID *pData, DWORD dwFlags, LPTHREAD_START_ROUTINE pfnCallback)
Definition: thread.c:356
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 L(x)
Definition: ntvdm.h:50
#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:37
WCHAR szPath[MAX_PATH]
Definition: shellfind.h:36
BOOL SearchHidden
Definition: shellfind.h:39
WCHAR szQuery[MAX_PATH]
Definition: shellfind.h:38
CStringA szQueryA
CStringW szQueryW
CStringW szFileName
CStringW szPath
CStringW szQueryU16BE
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:3748
#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 593 of file CFindFolder.cpp.

594{
595 if (m_hStopEvent)
596 {
599 }
600 return 0;
601}

◆ UpdateStatus()

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

Definition at line 620 of file CFindFolder.cpp.

621{
623 if (m_shellBrowser)
624 {
625 m_shellBrowser->SetStatusTextSB(status);
626 }
627
628 return 0;
629}

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

◆ 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: