ReactOS 0.4.15-dev-7887-g64a59a1
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 774 of file CFindFolder.cpp.

Member Function Documentation

◆ Create()

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

Definition at line 831 of file CFindFolder.cpp.

832 {
835 if (FAILED_UNEXPECTEDLY(hResult))
836 return hResult;
837 pObj->m_shellFolderView = pShellFolderView;
838 pObj->m_pInner = pInnerContextMenu;
839 return pObj->QueryInterface(IID_PPV_ARG(IContextMenu, pContextMenu));
840 }
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 825 of file CFindFolder.cpp.

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

◆ InvokeCommand()

STDMETHODIMP CFindFolderContextMenu::InvokeCommand ( LPCMINVOKECOMMANDINFO  lpcmi)
inlineprivate

Implements IContextMenu.

Definition at line 792 of file CFindFolder.cpp.

793 {
794 if (!IS_INTRESOURCE(lpcmi->lpVerb))
795 {
796 return m_pInner->InvokeCommand(lpcmi);
797 }
798
799 if (LOWORD(lpcmi->lpVerb) < m_firstCmdId + ADDITIONAL_MENU_ITEMS)
800 {
801 PCUITEMID_CHILD *apidl;
802 UINT cidl;
803 HRESULT hResult = m_shellFolderView->GetSelectedObjects(&apidl, &cidl);
804 if (FAILED_UNEXPECTEDLY(hResult))
805 return hResult;
806
807 for (UINT i = 0; i < cidl; i++)
808 {
810 if (!folderPidl)
811 return E_OUTOFMEMORY;
813 SHOpenFolderAndSelectItems(folderPidl, 1, &child, 0);
814 }
815 LocalFree(apidl); // Yes, LocalFree
816 return S_OK;
817 }
818
819 CMINVOKECOMMANDINFOEX actualCmdInfo;
820 memcpy(&actualCmdInfo, lpcmi, lpcmi->cbSize);
821 actualCmdInfo.lpVerb -= ADDITIONAL_MENU_ITEMS;
822 return m_pInner->InvokeCommand((CMINVOKECOMMANDINFO *)&actualCmdInfo);
823 }
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:995
EXTERN_C HRESULT WINAPI SHOpenFolderAndSelectItems(PCIDLIST_ABSOLUTE pidlFolder, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD dwFlags)
Definition: shlfolder.cpp:393
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 784 of file CFindFolder.cpp.

785 {
786 m_firstCmdId = indexMenu;
788 _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst++, MFT_SEPARATOR, NULL, 0);
789 return m_pInner->QueryContextMenu(hMenu, indexMenu, idCmdFirst, idCmdLast, uFlags);
790 }
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:179
#define MFT_SEPARATOR
Definition: winuser.h:744
#define MFS_ENABLED
Definition: winuser.h:750
#define MFT_STRING
Definition: winuser.h:746
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582

Member Data Documentation

◆ ADDITIONAL_MENU_ITEMS

const UINT CFindFolderContextMenu::ADDITIONAL_MENU_ITEMS = 2
staticprivate

Definition at line 781 of file CFindFolder.cpp.

Referenced by InvokeCommand().

◆ m_firstCmdId

UINT CFindFolderContextMenu::m_firstCmdId
private

Definition at line 780 of file CFindFolder.cpp.

Referenced by InvokeCommand(), and QueryContextMenu().

◆ m_pInner

CComPtr<IContextMenu> CFindFolderContextMenu::m_pInner
private

Definition at line 778 of file CFindFolder.cpp.

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

◆ m_shellFolderView

CComPtr<IShellFolderView> CFindFolderContextMenu::m_shellFolderView
private

Definition at line 779 of file CFindFolder.cpp.

Referenced by InvokeCommand().


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