ReactOS  0.4.15-dev-976-g0f66c66
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< CWindow, CControlWinTraits >
 CWindowImplBaseT ()
 
virtual void OnFinalMessage (HWND)
 
BOOL SubclassWindow (HWND hWnd)
 
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< CWindow >
 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 (int nID)
 
UINT GetDlgItemInt (int nID, BOOL *lpTrans=NULL, BOOL bSigned=TRUE) const
 
UINT GetDlgItemText (int nID, LPTSTR lpStr, int nMaxCount) const
 
BOOL GetDlgItemText (int nID, 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 (LPTSTR lpszStringBuf, int nMaxCount) const
 
BOOL GetWindowText (BSTR &bstrText)
 
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 ()
 
- Public Member Functions inherited from IShellFolder
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 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)
 
- Public Member Functions inherited from IUnknown
HRESULT QueryInterface ([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
 
ULONG AddRef ()
 
ULONG Release ()
 
- Public Member Functions inherited from ATL::IConnectionPointContainerImpl< CFindFolder >
STDMETHOD() EnumConnectionPoints (IEnumConnectionPoints **ppEnum)
 
STDMETHOD() FindConnectionPoint (REFIID riid, 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 >
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< CWindow >
enum  
 
- 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
 
- 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< CWindow, CControlWinTraits >
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< CWindow, CControlWinTraits >
WNDPROC m_pfnSuperWindowProc
 
- Public Attributes inherited from ATL::CWindowImplRoot< CWindow >
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 IShellFolder
SFGAO_STORAGEANCESTOR typedef ULONG SFGAOF
 
- 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
smooth NULL
Definition: ftsmooth.c:416

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 
603  CComHeapPtr<WCHAR> lpPath((LPWSTR) lParam);
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 }
static LPITEMIDLIST _ILCreate(LPCWSTR lpszPath)
Definition: CFindFolder.cpp:99
unsigned int UINT
Definition: ndis.h:50
CComPtr< IShellFolderView > m_shellFolderView
Definition: CFindFolder.h:68
WCHAR * LPWSTR
Definition: xmlstorage.h:184
LPARAM lParam
Definition: combotst.c:139

◆ BindToObject()

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

Definition at line 702 of file CFindFolder.cpp.

703 {
705  return E_NOTIMPL;
706 }
#define E_NOTIMPL
Definition: ddrawi.h:99
#define UNIMPLEMENTED
Definition: debug.h:115

◆ BindToStorage()

STDMETHODIMP CFindFolder::BindToStorage ( 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 E_NOTIMPL
Definition: ddrawi.h:99
#define UNIMPLEMENTED
Definition: debug.h:115

◆ CompareIDs()

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

Implements IShellFolder.

Definition at line 714 of file CFindFolder.cpp.

715 {
716  WORD wColumn = LOWORD(lParam);
717  switch (wColumn)
718  {
719  case 0: // Name
720  break;
721  case 1: // Path
722  return MAKE_COMPARE_HRESULT(StrCmpW(_ILGetPath(pidl1), _ILGetPath(pidl2)));
723  case 2: // Relevance
724  return E_NOTIMPL;
725  default: // Default columns
726  wColumn -= _countof(g_ColumnDefs) - 1;
727  break;
728  }
729  return m_pisfInner->CompareIDs(HIWORD(lParam) | wColumn, _ILGetFSPidl(pidl1), _ILGetFSPidl(pidl2));
730 }
#define MAKE_COMPARE_HRESULT(x)
Definition: shellutils.h:535
static LPCWSTR _ILGetPath(LPCITEMIDLIST pidl)
CComPtr< IShellFolder2 > m_pisfInner
Definition: CFindFolder.h:67
#define _countof(array)
Definition: sndvol32.h:68
unsigned short WORD
Definition: ntddk_ex.h:93
static LPCITEMIDLIST _ILGetFSPidl(LPCITEMIDLIST pidl)
int WINAPI StrCmpW(LPCWSTR lpszStr, LPCWSTR lpszComp)
Definition: string.c:434
#define E_NOTIMPL
Definition: ddrawi.h:99
#define HIWORD(l)
Definition: typedefs.h:247
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
static FolderViewColumns g_ColumnDefs[]
Definition: CFindFolder.cpp:87

◆ CreateViewObject()

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

Definition at line 732 of file CFindFolder.cpp.

733 {
734  if (riid == IID_IShellView)
735  {
736  SFV_CREATE sfvparams = {};
737  sfvparams.cbSize = sizeof(SFV_CREATE);
738  sfvparams.pshf = this;
739  sfvparams.psfvcb = this;
740  HRESULT hr = SHCreateShellFolderView(&sfvparams, (IShellView **) ppvOut);
741  if (FAILED_UNEXPECTEDLY(hr))
742  {
743  return hr;
744  }
745 
746  return ((IShellView * ) * ppvOut)->QueryInterface(IID_PPV_ARG(IShellFolderView, &m_shellFolderView));
747  }
748  return E_NOINTERFACE;
749 }
#define E_NOINTERFACE
Definition: winerror.h:2364
HRESULT hr
Definition: shlfolder.c:183
IShellFolderViewCB * psfvcb
Definition: shlobj.h:1285
REFIID riid
Definition: precomp.h:44
HRESULT WINAPI SHCreateShellFolderView(const SFV_CREATE *pcsfv, IShellView **ppsv)
Definition: CDefView.cpp:3585
#define IID_PPV_ARG(Itype, ppType)
struct _SFV_CREATE SFV_CREATE
LONG HRESULT
Definition: typedefs.h:79
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:71
IShellFolder * pshf
Definition: shlobj.h:1283
UINT cbSize
Definition: shlobj.h:1282
CComPtr< IShellFolderView > m_shellFolderView
Definition: CFindFolder.h:68

◆ EnumObjects()

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

Definition at line 696 of file CFindFolder.cpp.

697 {
698  *ppEnumIDList = NULL;
699  return S_FALSE;
700 }
#define S_FALSE
Definition: winerror.h:2357
smooth NULL
Definition: ftsmooth.c:416

◆ EnumSearches()

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

Implements IShellFolder2.

Definition at line 633 of file CFindFolder.cpp.

634 {
636  return E_NOTIMPL;
637 }
#define E_NOTIMPL
Definition: ddrawi.h:99
#define UNIMPLEMENTED
Definition: debug.h:115

◆ GetAttributesOf()

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

Definition at line 751 of file CFindFolder.cpp.

752 {
754  aFSPidl.Allocate(cidl);
755  for (UINT i = 0; i < cidl; i++)
756  {
757  aFSPidl[i] = _ILGetFSPidl(apidl[i]);
758  }
759 
760  return m_pisfInner->GetAttributesOf(cidl, aFSPidl, rgfInOut);
761 }
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
bool Allocate(_In_ size_t nElements=1)
Definition: atlalloc.h:143
CComPtr< IShellFolder2 > m_pisfInner
Definition: CFindFolder.h:67
static LPCITEMIDLIST _ILGetFSPidl(LPCITEMIDLIST pidl)
unsigned int UINT
Definition: ndis.h:50

◆ GetClassID()

STDMETHODIMP CFindFolder::GetClassID ( CLSID pClassId)
private

Implements IPersist.

Definition at line 948 of file CFindFolder.cpp.

949 {
950  if (pClassId == NULL)
951  return E_INVALIDARG;
952  *pClassId = CLSID_FindFolder;
953  return S_OK;
954 }
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
#define S_OK
Definition: intsafe.h:59

◆ GetCurFolder()

STDMETHODIMP CFindFolder::GetCurFolder ( PIDLIST_ABSOLUTE pidl)
private

Implements IPersistFolder2.

Definition at line 927 of file CFindFolder.cpp.

928 {
929  *pidl = ILClone(m_pidl);
930  return S_OK;
931 }
LPITEMIDLIST m_pidl
Definition: CFindFolder.h:66
#define S_OK
Definition: intsafe.h:59
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 }
#define S_OK
Definition: intsafe.h:59

◆ 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:18
#define E_INVALIDARG
Definition: ddrawi.h:101
CComPtr< IShellFolder2 > m_pisfInner
Definition: CFindFolder.h:67
#define _countof(array)
Definition: sndvol32.h:68
#define S_OK
Definition: intsafe.h:59
static FolderViewColumns g_ColumnDefs[]
Definition: CFindFolder.cpp:87

◆ GetDefaultSearchGUID()

STDMETHODIMP CFindFolder::GetDefaultSearchGUID ( GUID pguid)
private

Implements IShellFolder2.

Definition at line 627 of file CFindFolder.cpp.

628 {
630  return E_NOTIMPL;
631 }
#define E_NOTIMPL
Definition: ddrawi.h:99
#define UNIMPLEMENTED
Definition: debug.h:115

◆ 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 }
CComPtr< IShellFolder2 > m_pisfInner
Definition: CFindFolder.h:67

◆ 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 == 1)
675  {
676  return SHSetStrRet(&pDetails->str, _ILGetPath(pidl));
677  }
678 
679  return GetDisplayNameOf(pidl, SHGDN_NORMAL, &pDetails->str);
680 }
STRRET str
Definition: shtypes.idl:108
static LPCWSTR _ILGetPath(LPCITEMIDLIST pidl)
STDMETHODIMP GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET pName)
CComPtr< IShellFolder2 > m_pisfInner
Definition: CFindFolder.h:67
#define _countof(array)
Definition: sndvol32.h:68
static LPCITEMIDLIST _ILGetFSPidl(LPCITEMIDLIST pidl)
static FolderViewColumns g_ColumnDefs[]
Definition: CFindFolder.cpp:87

◆ GetDisplayNameOf()

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

Definition at line 875 of file CFindFolder.cpp.

876 {
877  return m_pisfInner->GetDisplayNameOf(_ILGetFSPidl(pidl), dwFlags, pName);
878 }
CComPtr< IShellFolder2 > m_pisfInner
Definition: CFindFolder.h:67
static LPSTR pName
Definition: security.c:75
static LPCITEMIDLIST _ILGetFSPidl(LPCITEMIDLIST pidl)
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175

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 837 of file CFindFolder.cpp.

839 {
840  if (cidl <= 0)
841  {
842  return m_pisfInner->GetUIObjectOf(hwndOwner, cidl, apidl, riid, prgfInOut, ppvOut);
843  }
844 
846  aFSPidl.Allocate(cidl);
847  for (UINT i = 0; i < cidl; i++)
848  {
849  aFSPidl[i] = _ILGetFSPidl(apidl[i]);
850  }
851 
852  if (riid == IID_IContextMenu)
853  {
855  if (!folderPidl)
856  return E_OUTOFMEMORY;
857  CComPtr<IShellFolder> pDesktopFolder;
858  HRESULT hResult = SHGetDesktopFolder(&pDesktopFolder);
859  if (FAILED_UNEXPECTEDLY(hResult))
860  return hResult;
861  CComPtr<IShellFolder> pShellFolder;
862  hResult = pDesktopFolder->BindToObject(folderPidl, NULL, IID_PPV_ARG(IShellFolder, &pShellFolder));
863  if (FAILED_UNEXPECTEDLY(hResult))
864  return hResult;
865  CComPtr<IContextMenu> pContextMenu;
866  hResult = pShellFolder->GetUIObjectOf(hwndOwner, cidl, aFSPidl, riid, prgfInOut, (LPVOID *)&pContextMenu);
867  if (FAILED_UNEXPECTEDLY(hResult))
868  return hResult;
869  return CFindFolderContextMenu::Create(m_shellFolderView, pContextMenu, (IContextMenu **)ppvOut);
870  }
871 
872  return m_pisfInner->GetUIObjectOf(hwndOwner, cidl, aFSPidl, riid, prgfInOut, ppvOut);
873 }
REFIID riid
Definition: precomp.h:44
#define IID_PPV_ARG(Itype, ppType)
static LPCWSTR _ILGetPath(LPCITEMIDLIST pidl)
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
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
bool Allocate(_In_ size_t nElements=1)
Definition: atlalloc.h:143
smooth NULL
Definition: ftsmooth.c:416
static HRESULT Create(IShellFolderView *pShellFolderView, IContextMenu *pInnerContextMenu, IContextMenu **pContextMenu)
CComPtr< IShellFolder2 > m_pisfInner
Definition: CFindFolder.h:67
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
LONG HRESULT
Definition: typedefs.h:79
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:71
static LPCITEMIDLIST _ILGetFSPidl(LPCITEMIDLIST pidl)
unsigned int UINT
Definition: ndis.h:50
CComPtr< IShellFolderView > m_shellFolderView
Definition: CFindFolder.h:68
LPITEMIDLIST WINAPI ILCreateFromPathW(LPCWSTR path)
Definition: pidl.c:982

◆ Initialize()

STDMETHODIMP CFindFolder::Initialize ( PCIDLIST_ABSOLUTE  pidl)
private

Implements IPersistFolder.

Definition at line 934 of file CFindFolder.cpp.

935 {
936  m_pidl = ILClone(pidl);
937  if (!m_pidl)
938  return E_OUTOFMEMORY;
939 
941  NULL,
942  NULL,
943  &CLSID_ShellFSFolder,
945 }
LPITEMIDLIST m_pidl
Definition: CFindFolder.h:66
#define IID_PPV_ARG(Itype, ppType)
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
smooth NULL
Definition: ftsmooth.c:416
CComPtr< IShellFolder2 > m_pisfInner
Definition: CFindFolder.h:67
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:228
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 682 of file CFindFolder.cpp.

683 {
685  return E_NOTIMPL;
686 }
#define E_NOTIMPL
Definition: ddrawi.h:99
#define UNIMPLEMENTED
Definition: debug.h:115

◆ MessageSFVCB()

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

Definition at line 888 of file CFindFolder.cpp.

889 {
890  switch (uMsg)
891  {
892  case SFVM_DEFVIEWMODE:
893  {
894  FOLDERVIEWMODE *pViewMode = (FOLDERVIEWMODE *) lParam;
895  *pViewMode = FVM_DETAILS;
896  return S_OK;
897  }
898  case SFVM_WINDOWCREATED:
899  {
900  // Subclass window to receive window messages
902 
903  // Get shell browser for updating status bar text
904  CComPtr<IServiceProvider> pServiceProvider;
905  HRESULT hr = m_shellFolderView->QueryInterface(IID_PPV_ARG(IServiceProvider, &pServiceProvider));
906  if (FAILED_UNEXPECTEDLY(hr))
907  return hr;
908  hr = pServiceProvider->QueryService(SID_SShellBrowser, IID_PPV_ARG(IShellBrowser, &m_shellBrowser));
909  if (FAILED_UNEXPECTEDLY(hr))
910  return hr;
911 
912  // Open search bar
913  CComPtr<IWebBrowser2> pWebBrowser2;
914  hr = m_shellBrowser->QueryInterface(IID_PPV_ARG(IWebBrowser2, &pWebBrowser2));
915  if (FAILED_UNEXPECTEDLY(hr))
916  return hr;
917  WCHAR pwszGuid[MAX_PATH];
918  StringFromGUID2(CLSID_FileSearchBand, pwszGuid, _countof(pwszGuid));
919  CComVariant searchBar(pwszGuid);
920  return pWebBrowser2->ShowBrowserBar(&searchBar, NULL, NULL);
921  }
922  }
923  return E_NOTIMPL;
924 }
HRESULT hr
Definition: shlfolder.c:183
#define IID_PPV_ARG(Itype, ppType)
WPARAM wParam
Definition: combotst.c:138
smooth NULL
Definition: ftsmooth.c:416
FOLDERVIEWMODE
Definition: shobjidl.idl:663
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:79
#define SFVM_WINDOWCREATED
Definition: shlobj.h:1235
#define _countof(array)
Definition: sndvol32.h:68
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:71
#define MAX_PATH
Definition: compat.h:34
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2434
#define SFVM_DEFVIEWMODE
Definition: shlobj.h:1245
#define S_OK
Definition: intsafe.h:59
#define E_NOTIMPL
Definition: ddrawi.h:99
CComPtr< IShellBrowser > m_shellBrowser
Definition: CFindFolder.h:69
CComPtr< IShellFolderView > m_shellFolderView
Definition: CFindFolder.h:68
#define SID_SShellBrowser
Definition: shlguid.h:125
LPARAM lParam
Definition: combotst.c:139

◆ 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 ** begin()
Definition: atlcom.h:1064
#define IID_PPV_ARG(Itype, ppType)
#define DISPATCH_METHOD
Definition: oleauto.h:1006
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:79
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:71
#define GUID_NULL
Definition: ks.h:106
IUnknown ** end()
Definition: atlcom.h:1069
struct stdole::DISPPARAMS DISPPARAMS

◆ ParseDisplayName()

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

Implements IShellFolder.

Definition at line 689 of file CFindFolder.cpp.

691 {
693  return E_NOTIMPL;
694 }
#define E_NOTIMPL
Definition: ddrawi.h:99
#define UNIMPLEMENTED
Definition: debug.h:115

◆ 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);
466  ::PostMessageW(data->hwnd, WM_SEARCH_UPDATE_STATUS, 0, (LPARAM) StrDupW(status.GetBuffer()));
467  ::SendMessageW(data->hwnd, WM_SEARCH_STOP, 0, 0);
468 
469  CloseHandle(data->hStopEvent);
470  delete data;
471 
472  return 0;
473 }
#define CloseHandle
Definition: compat.h:487
LPWSTR WINAPI StrDupW(LPCWSTR lpszStr)
Definition: string.c:1089
static UINT RecursiveFind(LPCWSTR lpPath, _SearchData *pSearchData)
#define DISPID_SEARCHSTART
Definition: exdispid.h:172
LONG_PTR LPARAM
Definition: windef.h:208
#define DISPID_SEARCHCOMPLETE
Definition: exdispid.h:173
#define IDS_SEARCH_FILES_FOUND
Definition: resource.h:172
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
LPVOID lpParameter
Definition: kernel32.h:241
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
unsigned int UINT
Definition: ndis.h:50
#define WM_SEARCH_STOP
Definition: shellfind.h:30
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_SEARCH_UPDATE_STATUS
Definition: shellfind.h:32
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

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 880 of file CFindFolder.cpp.

882 {
884  return E_NOTIMPL;
885 }
#define E_NOTIMPL
Definition: ddrawi.h:99
#define UNIMPLEMENTED
Definition: debug.h:115

◆ 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);
496  DWORD result;
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)
577  pSearchData->hStopEvent = m_hStopEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
578 
579  if (!SHCreateThread(SearchThreadProc, pSearchData, NULL, NULL))
580  {
581  SHFree(pSearchData);
582  return 0;
583  }
584 
585  return 0;
586 }
#define CreateEvent
Definition: winbase.h:3588
CStringW szQueryW
CStringA szQueryA
CComPtr< CFindFolder > pFindFolder
#define ERROR_SUCCESS
Definition: deptool.c:10
#define WideCharToMultiByte
Definition: compat.h:111
#define KEY_SET_VALUE
Definition: nt_native.h:1017
HANDLE m_hStopEvent
Definition: CFindFolder.h:70
#define LOBYTE(W)
Definition: jmemdos.c:487
#define MAKEWORD(a, b)
Definition: typedefs.h:248
#define TRUE
Definition: types.h:120
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define HIBYTE(W)
Definition: jmemdos.c:486
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
char * LPSTR
Definition: xmlstorage.h:182
static DWORD WINAPI SearchThreadProc(LPVOID lpParameter)
#define DWORD
Definition: nt_native.h:44
int32_t INT
Definition: typedefs.h:58
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
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
void ReleaseBuffer(_In_ int nNewLength=-1)
Definition: atlsimpstr.h:372
WCHAR szQuery[MAX_PATH]
Definition: shellfind.h:38
#define FALSE
Definition: types.h:117
#define CP_UTF8
Definition: nls.h:20
CStringW szFileName
CStringW szPath
static DWORD DWORD void LPSTR DWORD cch
Definition: str.c:201
smooth NULL
Definition: ftsmooth.c:416
WCHAR szFileName[MAX_PATH]
Definition: shellfind.h:37
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:4895
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR L[]
Definition: oid.c:1250
HWND m_hWnd
Definition: atlwin.h:268
unsigned char BYTE
Definition: xxhash.c:193
#define ERR(fmt,...)
Definition: debug.h:110
ULONG_PTR SIZE_T
Definition: typedefs.h:80
#define RegOpenKeyEx
Definition: winreg.h:520
WCHAR szPath[MAX_PATH]
Definition: shellfind.h:36
CStringW szQueryU16BE
unsigned int UINT
Definition: ndis.h:50
BOOL SearchHidden
Definition: shellfind.h:39
CComPtr< IShellFolderView > m_shellFolderView
Definition: CFindFolder.h:68
void WINAPI SHFree(LPVOID pv)
Definition: shellole.c:331
WCHAR * LPWSTR
Definition: xmlstorage.h:184
BOOL WINAPI SHCreateThread(LPTHREAD_START_ROUTINE pfnThreadProc, VOID *pData, DWORD dwFlags, LPTHREAD_START_ROUTINE pfnCallback)
Definition: thread.c:356
GLuint64EXT * result
Definition: glext.h:11304
#define REG_DWORD
Definition: sdbapi.c:596
LPARAM lParam
Definition: combotst.c:139
HANDLE hStopEvent
CStringA szQueryU8

◆ 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  {
593  m_hStopEvent = NULL;
594  }
595  return 0;
596 }
HANDLE m_hStopEvent
Definition: CFindFolder.h:70
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
smooth NULL
Definition: ftsmooth.c:416

◆ 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 }
CComPtr< IShellBrowser > m_shellBrowser
Definition: CFindFolder.h:69
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static SERVICE_STATUS status
Definition: service.c:31
LPARAM lParam
Definition: combotst.c:139
Definition: ps.c:97

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: