ReactOS 0.4.15-dev-5829-g6b6a045
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 598 of file CFindFolder.cpp.

599{
600 if (!lParam)
601 return 0;
602
604
605 CComHeapPtr<ITEMIDLIST> lpSearchPidl(_ILCreate(lpPath));
606 if (lpSearchPidl)
607 {
608 UINT uItemIndex;
609 m_shellFolderView->AddObject(lpSearchPidl, &uItemIndex);
610 }
611
612 return 0;
613}
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 708 of file CFindFolder.cpp.

709{
711 return E_NOTIMPL;
712}
#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 714 of file CFindFolder.cpp.

715{
717 return E_NOTIMPL;
718}

◆ CompareIDs()

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

Implements IShellFolder.

Definition at line 720 of file CFindFolder.cpp.

721{
722 WORD wColumn = LOWORD(lParam);
723 switch (wColumn)
724 {
725 case COL_NAME_INDEX: // Name
726 break;
727 case COL_LOCATION_INDEX: // Path
728 return MAKE_COMPARE_HRESULT(StrCmpW(_ILGetPath(pidl1), _ILGetPath(pidl2)));
729 case COL_RELEVANCE_INDEX: // Relevance
730 return E_NOTIMPL;
731 default: // Default columns
732 wColumn -= _countof(g_ColumnDefs) - 1;
733 break;
734 }
735 return m_pisfInner->CompareIDs(HIWORD(lParam) | wColumn, _ILGetFSPidl(pidl1), _ILGetFSPidl(pidl2));
736}
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:184
#define COL_RELEVANCE_INDEX
Definition: resource.h:186
#define COL_LOCATION_INDEX
Definition: resource.h:185
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:561
#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 738 of file CFindFolder.cpp.

739{
740 if (riid == IID_IShellView)
741 {
742 SFV_CREATE sfvparams = {};
743 sfvparams.cbSize = sizeof(SFV_CREATE);
744 sfvparams.pshf = this;
745 sfvparams.psfvcb = this;
746 HRESULT hr = SHCreateShellFolderView(&sfvparams, (IShellView **) ppvOut);
748 {
749 return hr;
750 }
751
752 return ((IShellView * ) * ppvOut)->QueryInterface(IID_PPV_ARG(IShellFolderView, &m_shellFolderView));
753 }
754 return E_NOINTERFACE;
755}
HRESULT WINAPI SHCreateShellFolderView(const SFV_CREATE *pcsfv, IShellView **ppsv)
Definition: CDefView.cpp:3931
REFIID riid
Definition: atlbase.h:39
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:82
HRESULT hr
Definition: shlfolder.c:183
struct _SFV_CREATE SFV_CREATE
IShellFolderViewCB * psfvcb
Definition: shlobj.h:1285
UINT cbSize
Definition: shlobj.h:1282
IShellFolder * pshf
Definition: shlobj.h:1283
#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 702 of file CFindFolder.cpp.

703{
704 *ppEnumIDList = NULL;
705 return S_FALSE;
706}
#define S_FALSE
Definition: winerror.h:2357

◆ EnumSearches()

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

Implements IShellFolder2.

Definition at line 633 of file CFindFolder.cpp.

634{
636 return E_NOTIMPL;
637}

◆ GetAttributesOf()

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

Definition at line 757 of file CFindFolder.cpp.

758{
760 aFSPidl.Allocate(cidl);
761 for (UINT i = 0; i < cidl; i++)
762 {
763 aFSPidl[i] = _ILGetFSPidl(apidl[i]);
764 }
765
766 return m_pisfInner->GetAttributesOf(cidl, aFSPidl, rgfInOut);
767}
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 954 of file CFindFolder.cpp.

955{
956 if (pClassId == NULL)
957 return E_INVALIDARG;
958 *pClassId = CLSID_FindFolder;
959 return S_OK;
960}
#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 933 of file CFindFolder.cpp.

934{
935 *pidl = ILClone(m_pidl);
936 return S_OK;
937}
LPITEMIDLIST m_pidl
Definition: CFindFolder.h:66
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:228

◆ GetDefaultColumn()

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

Implements IShellFolder2.

Definition at line 639 of file CFindFolder.cpp.

640{
641 if (pSort)
642 *pSort = 0;
643 if (pDisplay)
644 *pDisplay = 0;
645 return S_OK;
646}

◆ GetDefaultColumnState()

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

Implements IShellFolder2.

Definition at line 648 of file CFindFolder.cpp.

649{
650 if (!pcsFlags)
651 return E_INVALIDARG;
652 if (iColumn >= _countof(g_ColumnDefs))
653 return m_pisfInner->GetDefaultColumnState(iColumn - _countof(g_ColumnDefs) + 1, pcsFlags);
654 *pcsFlags = g_ColumnDefs[iColumn].dwDefaultState;
655 return S_OK;
656}
DWORD dwDefaultState
Definition: CFontExt.cpp:21

◆ GetDefaultSearchGUID()

STDMETHODIMP CFindFolder::GetDefaultSearchGUID ( GUID pguid)
private

Implements IShellFolder2.

Definition at line 627 of file CFindFolder.cpp.

628{
630 return E_NOTIMPL;
631}

◆ GetDetailsEx()

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

Implements IShellFolder2.

Definition at line 658 of file CFindFolder.cpp.

659{
660 return m_pisfInner->GetDetailsEx(pidl, pscid, pv);
661}

◆ GetDetailsOf()

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

Implements IShellFolder2.

Definition at line 663 of file CFindFolder.cpp.

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

882{
883 return m_pisfInner->GetDisplayNameOf(_ILGetFSPidl(pidl), dwFlags, pName);
884}
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 843 of file CFindFolder.cpp.

845{
846 if (cidl <= 0)
847 {
848 return m_pisfInner->GetUIObjectOf(hwndOwner, cidl, apidl, riid, prgfInOut, ppvOut);
849 }
850
852 aFSPidl.Allocate(cidl);
853 for (UINT i = 0; i < cidl; i++)
854 {
855 aFSPidl[i] = _ILGetFSPidl(apidl[i]);
856 }
857
858 if (riid == IID_IContextMenu)
859 {
861 if (!folderPidl)
862 return E_OUTOFMEMORY;
863 CComPtr<IShellFolder> pDesktopFolder;
864 HRESULT hResult = SHGetDesktopFolder(&pDesktopFolder);
865 if (FAILED_UNEXPECTEDLY(hResult))
866 return hResult;
867 CComPtr<IShellFolder> pShellFolder;
868 hResult = pDesktopFolder->BindToObject(folderPidl, NULL, IID_PPV_ARG(IShellFolder, &pShellFolder));
869 if (FAILED_UNEXPECTEDLY(hResult))
870 return hResult;
871 CComPtr<IContextMenu> pContextMenu;
872 hResult = pShellFolder->GetUIObjectOf(hwndOwner, cidl, aFSPidl, riid, prgfInOut, (LPVOID *)&pContextMenu);
873 if (FAILED_UNEXPECTEDLY(hResult))
874 return hResult;
875 return CFindFolderContextMenu::Create(m_shellFolderView, pContextMenu, (IContextMenu **)ppvOut);
876 }
877
878 return m_pisfInner->GetUIObjectOf(hwndOwner, cidl, aFSPidl, riid, prgfInOut, ppvOut);
879}
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:982

◆ Initialize()

STDMETHODIMP CFindFolder::Initialize ( PCIDLIST_ABSOLUTE  pidl)
private

Implements IPersistFolder.

Definition at line 940 of file CFindFolder.cpp.

941{
942 m_pidl = ILClone(pidl);
943 if (!m_pidl)
944 return E_OUTOFMEMORY;
945
947 NULL,
948 NULL,
949 &CLSID_ShellFSFolder,
951}
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 688 of file CFindFolder.cpp.

689{
691 return E_NOTIMPL;
692}

◆ MessageSFVCB()

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

Definition at line 894 of file CFindFolder.cpp.

895{
896 switch (uMsg)
897 {
898 case SFVM_DEFVIEWMODE:
899 {
900 FOLDERVIEWMODE *pViewMode = (FOLDERVIEWMODE *) lParam;
901 *pViewMode = FVM_DETAILS;
902 return S_OK;
903 }
905 {
906 // Subclass window to receive window messages
908
909 // Get shell browser for updating status bar text
910 CComPtr<IServiceProvider> pServiceProvider;
911 HRESULT hr = m_shellFolderView->QueryInterface(IID_PPV_ARG(IServiceProvider, &pServiceProvider));
913 return hr;
914 hr = pServiceProvider->QueryService(SID_SShellBrowser, IID_PPV_ARG(IShellBrowser, &m_shellBrowser));
916 return hr;
917
918 // Open search bar
919 CComPtr<IWebBrowser2> pWebBrowser2;
920 hr = m_shellBrowser->QueryInterface(IID_PPV_ARG(IWebBrowser2, &pWebBrowser2));
922 return hr;
923 WCHAR pwszGuid[MAX_PATH];
924 StringFromGUID2(CLSID_FileSearchBand, pwszGuid, _countof(pwszGuid));
925 CComVariant searchBar(pwszGuid);
926 return pWebBrowser2->ShowBrowserBar(&searchBar, NULL, NULL);
927 }
928 }
929 return E_NOTIMPL;
930}
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:1245
#define SFVM_WINDOWCREATED
Definition: shlobj.h:1235
FOLDERVIEWMODE
Definition: shobjidl.idl:666
@ FVM_DETAILS
Definition: shobjidl.idl:672
#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 475 of file CFindFolder.cpp.

476{
477 DISPPARAMS dispatchParams = {0};
478 CComDynamicUnkArray &subscribers =
480 for (IUnknown** pSubscriber = subscribers.begin(); pSubscriber < subscribers.end(); pSubscriber++)
481 {
482 if (!*pSubscriber)
483 continue;
484
485 CComPtr<IDispatch> pDispatch;
486 HRESULT hResult = (*pSubscriber)->QueryInterface(IID_PPV_ARG(IDispatch, &pDispatch));
487 if (!FAILED_UNEXPECTEDLY(hResult))
488 pDispatch->Invoke(id, GUID_NULL, 0, DISPATCH_METHOD, &dispatchParams, NULL, NULL, NULL);
489 }
490}
IUnknown ** end()
Definition: atlcom.h:1070
IUnknown ** begin()
Definition: atlcom.h:1065
#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 695 of file CFindFolder.cpp.

697{
699 return E_NOTIMPL;
700}

◆ 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
458 data->pFindFolder->NotifyConnections(DISPID_SEARCHSTART);
459
460 UINT uTotalFound = RecursiveFind(data->szPath, data);
461
462 data->pFindFolder->NotifyConnections(DISPID_SEARCHCOMPLETE);
463
465 status.Format(IDS_SEARCH_FILES_FOUND, uTotalFound);
467 ::SendMessageW(data->hwnd, WM_SEARCH_STOP, 0, 0);
468
469 CloseHandle(data->hStopEvent);
470 delete data;
471
472 return 0;
473}
static UINT RecursiveFind(LPCWSTR lpPath, _SearchData *pSearchData)
#define IDS_SEARCH_FILES_FOUND
Definition: resource.h:176
#define CloseHandle
Definition: compat.h:739
LPWSTR WINAPI StrDupW(LPCWSTR lpszStr)
Definition: string.c:1089
#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 WM_SEARCH_UPDATE_STATUS
Definition: shellfind.h:32
#define WM_SEARCH_STOP
Definition: shellfind.h:30
CComPtr< CFindFolder > pFindFolder
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 886 of file CFindFolder.cpp.

888{
890 return E_NOTIMPL;
891}

◆ StartSearch()

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

Definition at line 492 of file CFindFolder.cpp.

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

589{
590 if (m_hStopEvent)
591 {
594 }
595 return 0;
596}

◆ UpdateStatus()

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

Definition at line 615 of file CFindFolder.cpp.

616{
618 if (m_shellBrowser)
619 {
620 m_shellBrowser->SetStatusTextSB(status);
621 }
622
623 return 0;
624}

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: