ReactOS 0.4.16-dev-226-g79f2289
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 IContextMenuLPCONTEXTMENU
 
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
 
HRESULT QueryContextMenu ([in] HMENU hmenu, [in] UINT indexMenu, [in] UINT idCmdFirst, [in] UINT idCmdLast, [in] UINT uFlags)
 
HRESULT InvokeCommand ([in] LPCMINVOKECOMMANDINFO lpici)
 
HRESULT GetCommandString ([in] UINT_PTR idCmd, [in] UINT uType, [out] UINT *pwReserved, [out, size_is(cchMax)] LPSTR pszName, [in] UINT cchMax)
 
- 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 ATL::CComObjectRootBase
LONG m_dwRef
 
- Static Public Attributes inherited from IContextMenu
static 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 782 of file CFindFolder.cpp.

Member Function Documentation

◆ Create()

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

Definition at line 839 of file CFindFolder.cpp.

840 {
843 if (FAILED_UNEXPECTEDLY(hResult))
844 return hResult;
845 pObj->m_shellFolderView = pShellFolderView;
846 pObj->m_pInner = pInnerContextMenu;
847 return pObj->QueryInterface(IID_PPV_ARG(IContextMenu, pContextMenu));
848 }
static HRESULT WINAPI CreateInstance(CComObject< Base > **pp)
Definition: atlcom.h:171
STDMETHOD() QueryInterface(REFIID iid, void **ppvObject)
Definition: atlcom.h:166
#define FAILED_UNEXPECTEDLY(hr)
Definition: precomp.h:121
#define IID_PPV_ARG(Itype, ppType)

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

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

◆ InvokeCommand()

STDMETHODIMP CFindFolderContextMenu::InvokeCommand ( LPCMINVOKECOMMANDINFO  lpcmi)
inlineprivate

Implements IContextMenu.

Definition at line 800 of file CFindFolder.cpp.

801 {
802 if (!IS_INTRESOURCE(lpcmi->lpVerb))
803 {
804 return m_pInner->InvokeCommand(lpcmi);
805 }
806
807 if (LOWORD(lpcmi->lpVerb) < m_firstCmdId + ADDITIONAL_MENU_ITEMS)
808 {
809 PCUITEMID_CHILD *apidl;
810 UINT cidl;
811 HRESULT hResult = m_shellFolderView->GetSelectedObjects(&apidl, &cidl);
812 if (FAILED_UNEXPECTEDLY(hResult))
813 return hResult;
814
815 for (UINT i = 0; i < cidl; i++)
816 {
818 if (!folderPidl)
819 return E_OUTOFMEMORY;
821 SHOpenFolderAndSelectItems(folderPidl, 1, &child, 0);
822 }
823 LocalFree(apidl); // Yes, LocalFree
824 return S_OK;
825 }
826
827 CMINVOKECOMMANDINFOEX actualCmdInfo;
828 memcpy(&actualCmdInfo, lpcmi, lpcmi->cbSize);
829 actualCmdInfo.lpVerb -= ADDITIONAL_MENU_ITEMS;
830 return m_pInner->InvokeCommand((CMINVOKECOMMANDINFO *)&actualCmdInfo);
831 }
static LPCWSTR _ILGetPath(LPCITEMIDLIST pidl)
static LPCITEMIDLIST _ILGetFSPidl(LPCITEMIDLIST pidl)
static const UINT ADDITIONAL_MENU_ITEMS
CComPtr< IShellFolderView > m_shellFolderView
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
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
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594
struct IContextMenu::tagCMINVOKECOMMANDINFO CMINVOKECOMMANDINFO
struct IContextMenu::tagCMInvokeCommandInfoEx CMINVOKECOMMANDINFOEX
#define S_OK
Definition: intsafe.h:52
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static HWND child
Definition: cursoricon.c:298
unsigned int UINT
Definition: ndis.h:50
#define LOWORD(l)
Definition: pedump.c:82
LPITEMIDLIST WINAPI ILCreateFromPathW(LPCWSTR path)
Definition: pidl.c:1003
EXTERN_C HRESULT WINAPI SHOpenFolderAndSelectItems(PCIDLIST_ABSOLUTE pidlFolder, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD dwFlags)
Definition: shlfolder.cpp:437
const ITEMID_CHILD UNALIGNED * PCUITEMID_CHILD
Definition: shtypes.idl:70
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
#define IS_INTRESOURCE(i)
Definition: winuser.h:580

◆ QueryContextMenu()

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

Implements IContextMenu.

Definition at line 792 of file CFindFolder.cpp.

793 {
794 m_firstCmdId = indexMenu;
796 _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst++, MFT_SEPARATOR, NULL, 0);
797 return m_pInner->QueryContextMenu(hMenu, indexMenu, idCmdFirst, idCmdLast, uFlags);
798 }
static void WINAPI _InsertMenuItemW(HMENU hMenu, UINT indexMenu, BOOL fByPosition, UINT wID, UINT fType, LPCWSTR dwTypeData, UINT fState)
Definition: CFindFolder.cpp:40
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define IDS_SEARCH_OPEN_FOLDER
Definition: resource.h:178
#define MFT_SEPARATOR
Definition: winuser.h:747
#define MFS_ENABLED
Definition: winuser.h:753
#define MFT_STRING
Definition: winuser.h:749
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582

Member Data Documentation

◆ ADDITIONAL_MENU_ITEMS

const UINT CFindFolderContextMenu::ADDITIONAL_MENU_ITEMS = 2
staticprivate

Definition at line 789 of file CFindFolder.cpp.

Referenced by InvokeCommand().

◆ m_firstCmdId

UINT CFindFolderContextMenu::m_firstCmdId
private

Definition at line 788 of file CFindFolder.cpp.

Referenced by InvokeCommand(), and QueryContextMenu().

◆ m_pInner

CComPtr<IContextMenu> CFindFolderContextMenu::m_pInner
private

Definition at line 786 of file CFindFolder.cpp.

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

◆ m_shellFolderView

CComPtr<IShellFolderView> CFindFolderContextMenu::m_shellFolderView
private

Definition at line 787 of file CFindFolder.cpp.

Referenced by InvokeCommand().


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