ReactOS  0.4.15-dev-3453-gff89651
CFindFolderContextMenu Class Reference
Inheritance diagram for CFindFolderContextMenu:
Collaboration diagram for CFindFolderContextMenu:

Static Public Member Functions

static HRESULT Create (IShellFolderView *pShellFolderView, IContextMenu *pInnerContextMenu, IContextMenu **pContextMenu)
 
- 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)
 

Private Member Functions

STDMETHODIMP QueryContextMenu (HMENU hMenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags)
 
STDMETHODIMP InvokeCommand (LPCMINVOKECOMMANDINFO lpcmi)
 
STDMETHODIMP GetCommandString (UINT_PTR idCommand, UINT uFlags, UINT *lpReserved, LPSTR lpszName, UINT uMaxNameLen)
 

Private Attributes

CComPtr< IContextMenum_pInner
 
CComPtr< IShellFolderView > m_shellFolderView
 
UINT m_firstCmdId
 

Static Private Attributes

static const UINT ADDITIONAL_MENU_ITEMS = 2
 

Additional Inherited Members

- Public Types inherited from IContextMenu
typedef struct IContextMenu::tagCMINVOKECOMMANDINFO CMINVOKECOMMANDINFO
 
typedef struct IContextMenu::tagCMINVOKECOMMANDINFOLPCMINVOKECOMMANDINFO
 
typedef struct IContextMenu::tagCMInvokeCommandInfoEx CMINVOKECOMMANDINFOEX
 
typedef struct IContextMenu::tagCMInvokeCommandInfoExLPCMINVOKECOMMANDINFOEX
 
- Public Types inherited from IUnknown
typedef IUnknownLPUNKNOWN
 
- 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::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 Attributes inherited from IContextMenu
CMIC_MASK_NOZONECHECKS typedef IContextMenuLPCONTEXTMENU
 
- Public Attributes inherited from ATL::CComObjectRootBase
LONG m_dwRef
 
- Static Public Attributes inherited from IContextMenu
static CMDSTR_VIEWDETAILSW(const WCHAR []) const WCHAR CMDSTR_NEWFOLDERW [] = {'N','e','w','F','o','l','d','e','r',0}
 
static const WCHAR CMDSTR_VIEWLISTW [] = {'V','i','e','w','L','i','s','t',0}
 
static const WCHAR CMDSTR_VIEWDETAILSW [] = {'V','i','e','w','D','e','t','a','i','l','s',0}
 

Detailed Description

Definition at line 763 of file CFindFolder.cpp.

Member Function Documentation

◆ Create()

static HRESULT CFindFolderContextMenu::Create ( IShellFolderView *  pShellFolderView,
IContextMenu pInnerContextMenu,
IContextMenu **  pContextMenu 
)
inlinestatic

Definition at line 821 of file CFindFolder.cpp.

822  {
825  if (FAILED_UNEXPECTEDLY(hResult))
826  return hResult;
827  pObj->m_shellFolderView = pShellFolderView;
828  pObj->m_pInner = pInnerContextMenu;
829  return pObj->QueryInterface(IID_PPV_ARG(IContextMenu, pContextMenu));
830  }
#define IID_PPV_ARG(Itype, ppType)
LONG HRESULT
Definition: typedefs.h:79
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:82
STDMETHOD() QueryInterface(REFIID iid, void **ppvObject)
Definition: atlcom.h:161

Referenced by CFindFolder::GetUIObjectOf().

◆ GetCommandString()

STDMETHODIMP CFindFolderContextMenu::GetCommandString ( UINT_PTR  idCommand,
UINT  uFlags,
UINT lpReserved,
LPSTR  lpszName,
UINT  uMaxNameLen 
)
inlineprivate

Implements IContextMenu.

Definition at line 815 of file CFindFolder.cpp.

816  {
817  return m_pInner->GetCommandString(idCommand, uFlags, lpReserved, lpszName, uMaxNameLen);
818  }
UINT uFlags
Definition: api.c:59
CComPtr< IContextMenu > m_pInner

◆ InvokeCommand()

STDMETHODIMP CFindFolderContextMenu::InvokeCommand ( LPCMINVOKECOMMANDINFO  lpcmi)
inlineprivate

Implements IContextMenu.

Definition at line 781 of file CFindFolder.cpp.

782  {
783  if (!IS_INTRESOURCE(lpcmi->lpVerb))
784  {
785  return m_pInner->InvokeCommand(lpcmi);
786  }
787 
788  if (LOWORD(lpcmi->lpVerb) < m_firstCmdId + ADDITIONAL_MENU_ITEMS)
789  {
790  PCUITEMID_CHILD *apidl;
791  UINT cidl;
792  HRESULT hResult = m_shellFolderView->GetSelectedObjects(&apidl, &cidl);
793  if (FAILED_UNEXPECTEDLY(hResult))
794  return hResult;
795 
796  for (UINT i = 0; i < cidl; i++)
797  {
799  if (!folderPidl)
800  return E_OUTOFMEMORY;
801  CComHeapPtr<ITEMIDLIST> filePidl(ILCombine(folderPidl, _ILGetFSPidl(apidl[i])));
802  if (!filePidl)
803  return E_OUTOFMEMORY;
804  SHOpenFolderAndSelectItems(folderPidl, 1, &filePidl, 0);
805  }
806  return S_OK;
807  }
808 
809  CMINVOKECOMMANDINFOEX actualCmdInfo;
810  memcpy(&actualCmdInfo, lpcmi, lpcmi->cbSize);
811  actualCmdInfo.lpVerb -= ADDITIONAL_MENU_ITEMS;
812  return m_pInner->InvokeCommand((CMINVOKECOMMANDINFO *)&actualCmdInfo);
813  }
struct IContextMenu::tagCMINVOKECOMMANDINFO CMINVOKECOMMANDINFO
LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: pidl.c:699
EXTERN_C HRESULT WINAPI SHOpenFolderAndSelectItems(PCIDLIST_ABSOLUTE pidlFolder, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD dwFlags)
Definition: shlfolder.cpp:368
const ITEMID_CHILD UNALIGNED * PCUITEMID_CHILD
Definition: shtypes.idl:70
static LPCWSTR _ILGetPath(LPCITEMIDLIST pidl)
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static const UINT ADDITIONAL_MENU_ITEMS
#define IS_INTRESOURCE(i)
Definition: winuser.h:580
LONG HRESULT
Definition: typedefs.h:79
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:82
static LPCITEMIDLIST _ILGetFSPidl(LPCITEMIDLIST pidl)
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define S_OK
Definition: intsafe.h:52
CComPtr< IShellFolderView > m_shellFolderView
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
struct IContextMenu::tagCMInvokeCommandInfoEx CMINVOKECOMMANDINFOEX
unsigned int UINT
Definition: ndis.h:50
LPITEMIDLIST WINAPI ILCreateFromPathW(LPCWSTR path)
Definition: pidl.c:982
CComPtr< IContextMenu > m_pInner
#define LOWORD(l)
Definition: pedump.c:82

◆ QueryContextMenu()

STDMETHODIMP CFindFolderContextMenu::QueryContextMenu ( HMENU  hMenu,
UINT  indexMenu,
UINT  idCmdFirst,
UINT  idCmdLast,
UINT  uFlags 
)
inlineprivate

Implements IContextMenu.

Definition at line 773 of file CFindFolder.cpp.

774  {
775  m_firstCmdId = indexMenu;
777  _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst++, MFT_SEPARATOR, NULL, 0);
778  return m_pInner->QueryContextMenu(hMenu, indexMenu, idCmdFirst, idCmdLast, uFlags);
779  }
#define MFT_STRING
Definition: winuser.h:741
#define TRUE
Definition: types.h:120
UINT uFlags
Definition: api.c:59
static void WINAPI _InsertMenuItemW(HMENU hMenu, UINT indexMenu, BOOL fByPosition, UINT wID, UINT fType, LPCWSTR dwTypeData, UINT fState)
Definition: CFindFolder.cpp:40
#define MFS_ENABLED
Definition: winuser.h:745
#define IDS_SEARCH_OPEN_FOLDER
Definition: resource.h:178
#define MFT_SEPARATOR
Definition: winuser.h:739
#define NULL
Definition: types.h:112
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
CComPtr< IContextMenu > m_pInner

Member Data Documentation

◆ ADDITIONAL_MENU_ITEMS

const UINT CFindFolderContextMenu::ADDITIONAL_MENU_ITEMS = 2
staticprivate

Definition at line 770 of file CFindFolder.cpp.

Referenced by InvokeCommand().

◆ m_firstCmdId

UINT CFindFolderContextMenu::m_firstCmdId
private

Definition at line 769 of file CFindFolder.cpp.

Referenced by InvokeCommand(), and QueryContextMenu().

◆ m_pInner

CComPtr<IContextMenu> CFindFolderContextMenu::m_pInner
private

Definition at line 767 of file CFindFolder.cpp.

Referenced by GetCommandString(), InvokeCommand(), and QueryContextMenu().

◆ m_shellFolderView

CComPtr<IShellFolderView> CFindFolderContextMenu::m_shellFolderView
private

Definition at line 768 of file CFindFolder.cpp.

Referenced by InvokeCommand().


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