ReactOS 0.4.16-dev-1097-g530d26a
CFolderItemVerbs Class Reference

#include <CFolderItemVerbs.h>

Inheritance diagram for CFolderItemVerbs:
Collaboration diagram for CFolderItemVerbs:

Public Member Functions

 CFolderItemVerbs ()
 
virtual ~CFolderItemVerbs ()
 
HRESULT Init (LPITEMIDLIST idlist)
 
STDMETHOD() get_Count (LONG *plCount) override
 
STDMETHOD() get_Application (IDispatch **ppid) override
 
STDMETHOD() get_Parent (IDispatch **ppid) override
 
STDMETHOD() Item (VARIANT index, FolderItemVerb **ppid) override
 
STDMETHOD() _NewEnum (IUnknown **ppunk) override
 
- 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 ()
 

Private Attributes

CComPtr< IContextMenum_contextmenu
 
HMENU m_menu
 
int m_count
 

Additional Inherited Members

- 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::CComObjectRootBase
LONG m_dwRef
 

Detailed Description

Definition at line 56 of file CFolderItemVerbs.h.

Constructor & Destructor Documentation

◆ CFolderItemVerbs()

CFolderItemVerbs::CFolderItemVerbs ( )

Definition at line 81 of file CFolderItemVerbs.cpp.

82 :m_menu(NULL)
83 ,m_count(0)
84{
85}
#define NULL
Definition: types.h:112

◆ ~CFolderItemVerbs()

CFolderItemVerbs::~CFolderItemVerbs ( )
virtual

Definition at line 87 of file CFolderItemVerbs.cpp.

88{
90}
BOOL WINAPI DestroyMenu(_In_ HMENU)

Member Function Documentation

◆ _NewEnum()

HRESULT STDMETHODCALLTYPE CFolderItemVerbs::_NewEnum ( IUnknown **  ppunk)
override

Definition at line 185 of file CFolderItemVerbs.cpp.

186{
187 TRACE("(%p, %p)\n", this, ppunk);
188 return E_NOTIMPL;
189}
#define E_NOTIMPL
Definition: ddrawi.h:99
#define TRACE(s)
Definition: solgame.cpp:4

◆ get_Application()

HRESULT STDMETHODCALLTYPE CFolderItemVerbs::get_Application ( IDispatch **  ppid)
override

Definition at line 117 of file CFolderItemVerbs.cpp.

118{
119 TRACE("(%p, %p)\n", this, ppid);
120
121 if (ppid)
122 *ppid = NULL;
123
124 return E_NOTIMPL;
125}

◆ get_Count()

HRESULT STDMETHODCALLTYPE CFolderItemVerbs::get_Count ( LONG plCount)
override

Definition at line 109 of file CFolderItemVerbs.cpp.

110{
111 if (!plCount)
112 return E_INVALIDARG;
113 *plCount = m_count;
114 return S_OK;
115}
#define E_INVALIDARG
Definition: ddrawi.h:101
#define S_OK
Definition: intsafe.h:52

◆ get_Parent()

HRESULT STDMETHODCALLTYPE CFolderItemVerbs::get_Parent ( IDispatch **  ppid)
override

Definition at line 127 of file CFolderItemVerbs.cpp.

128{
129 TRACE("(%p, %p)\n", this, ppid);
130
131 if (ppid)
132 *ppid = NULL;
133
134 return E_NOTIMPL;
135}

◆ Init()

HRESULT CFolderItemVerbs::Init ( LPITEMIDLIST  idlist)

Definition at line 92 of file CFolderItemVerbs.cpp.

93{
96 return hr;
97
99 hr = m_contextmenu->QueryContextMenu(m_menu, 0, FCIDM_SHVIEWFIRST, FCIDM_SHVIEWLAST, CMF_NORMAL);
100 if (!SUCCEEDED(hr))
101 return hr;
102
104 return hr;
105}
CComPtr< IContextMenu > m_contextmenu
#define FAILED_UNEXPECTEDLY(hr)
Definition: precomp.h:65
EXTERN_C HRESULT SHELL_GetUIObjectOfAbsoluteItem(_In_opt_ HWND hWnd, _In_ PCIDLIST_ABSOLUTE pidl, _In_ REFIID riid, _Out_ void **ppvObj)
Definition: utils.cpp:380
#define SUCCEEDED(hr)
Definition: intsafe.h:50
HRESULT hr
Definition: shlfolder.c:183
#define FCIDM_SHVIEWFIRST
Definition: shlobj.h:588
#define FCIDM_SHVIEWLAST
Definition: shlobj.h:622
HMENU WINAPI CreatePopupMenu(void)
Definition: menu.c:838
int WINAPI GetMenuItemCount(_In_opt_ HMENU)
#define IID_PPV_ARG(Itype, ppType)

◆ Item()

HRESULT STDMETHODCALLTYPE CFolderItemVerbs::Item ( VARIANT  index,
FolderItemVerb **  ppid 
)
override

Definition at line 137 of file CFolderItemVerbs.cpp.

138{
139 if (!ppid)
140 return E_POINTER;
141
143
144 HRESULT hr = VariantChangeType(&var, &indexVar, 0, VT_I4);
146 return E_INVALIDARG;
147
148 int index = V_I4(&var);
149
150 if (index > m_count)
151 return S_OK;
152
153 BSTR name = NULL;
154
155 if(index == m_count)
156 {
158 }
159 else
160 {
161 MENUITEMINFOW info = { sizeof(info), 0 };
162 info.fMask = MIIM_STRING;
164 return E_FAIL;
166 if (name)
167 {
168 info.dwTypeData = name;
169 info.cch++;
171 }
172 }
173
174 if (!name)
175 return E_OUTOFMEMORY;
176
178 verb->Init(m_contextmenu, name);
179 verb->AddRef();
180 *ppid = verb;
181
182 return S_OK;
183}
void Init(IContextMenu *menu, BSTR name)
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_FAIL
Definition: ddrawi.h:102
#define TRUE
Definition: types.h:120
OLECHAR * BSTR
Definition: compat.h:2293
@ VT_I4
Definition: compat.h:2298
GLuint index
Definition: glext.h:6031
const char * var
Definition: shader.c:5666
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:339
#define V_I4(A)
Definition: oleauto.h:247
Definition: name.c:39
HRESULT WINAPI DECLSPEC_HOTPATCH VariantChangeType(VARIANTARG *pvargDest, VARIANTARG *pvargSrc, USHORT wFlags, VARTYPE vt)
Definition: variant.c:962
#define E_POINTER
Definition: winerror.h:2365
#define MIIM_STRING
Definition: winuser.h:738
BOOL WINAPI GetMenuItemInfoW(_In_ HMENU, _In_ UINT, _In_ BOOL, _Inout_ LPMENUITEMINFOW)

Member Data Documentation

◆ m_contextmenu

CComPtr<IContextMenu> CFolderItemVerbs::m_contextmenu
private

Definition at line 62 of file CFolderItemVerbs.h.

Referenced by Init(), and Item().

◆ m_count

int CFolderItemVerbs::m_count
private

Definition at line 64 of file CFolderItemVerbs.h.

Referenced by get_Count(), Init(), and Item().

◆ m_menu

HMENU CFolderItemVerbs::m_menu
private

Definition at line 63 of file CFolderItemVerbs.h.

Referenced by Init(), Item(), and ~CFolderItemVerbs().


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