ReactOS 0.4.15-dev-7942-gd23573b
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 191 of file CFolderItemVerbs.cpp.

192{
193 TRACE("(%p, %p)\n", this, ppunk);
194 return E_NOTIMPL;
195}
#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 123 of file CFolderItemVerbs.cpp.

124{
125 TRACE("(%p, %p)\n", this, ppid);
126
127 if (ppid)
128 *ppid = NULL;
129
130 return E_NOTIMPL;
131}

◆ get_Count()

HRESULT STDMETHODCALLTYPE CFolderItemVerbs::get_Count ( LONG plCount)
override

Definition at line 115 of file CFolderItemVerbs.cpp.

116{
117 if (!plCount)
118 return E_INVALIDARG;
119 *plCount = m_count;
120 return S_OK;
121}
#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 133 of file CFolderItemVerbs.cpp.

134{
135 TRACE("(%p, %p)\n", this, ppid);
136
137 if (ppid)
138 *ppid = NULL;
139
140 return E_NOTIMPL;
141}

◆ Init()

HRESULT CFolderItemVerbs::Init ( LPITEMIDLIST  idlist)

Definition at line 92 of file CFolderItemVerbs.cpp.

93{
98 return hr;
99
100 hr = folder->GetUIObjectOf(NULL, 1, &child, IID_IContextMenu, NULL, (PVOID*)&m_contextmenu);
102 return hr;
103
105 hr = m_contextmenu->QueryContextMenu(m_menu, 0, FCIDM_SHVIEWFIRST, FCIDM_SHVIEWLAST, CMF_NORMAL);
106 if (!SUCCEEDED(hr))
107 return hr;
108
110 return hr;
111}
CComPtr< IContextMenu > m_contextmenu
#define FAILED_UNEXPECTEDLY(hr)
Definition: precomp.h:121
#define SUCCEEDED(hr)
Definition: intsafe.h:50
static HWND child
Definition: cursoricon.c:298
HRESULT WINAPI SHBindToParent(LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppv, LPCITEMIDLIST *ppidlLast)
Definition: pidl.c:1361
HRESULT hr
Definition: shlfolder.c:183
#define FCIDM_SHVIEWFIRST
Definition: shlobj.h:573
#define FCIDM_SHVIEWLAST
Definition: shlobj.h:607
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
Definition: fci.c:116
HMENU WINAPI CreatePopupMenu(void)
Definition: menu.c:838
int WINAPI GetMenuItemCount(_In_opt_ HMENU)
#define IID_PPV_ARG(Itype, ppType)

Referenced by CFolderItem::Verbs().

◆ Item()

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

Definition at line 143 of file CFolderItemVerbs.cpp.

144{
145 if (!ppid)
146 return E_POINTER;
147
149
150 HRESULT hr = VariantChangeType(&var, &indexVar, 0, VT_I4);
152 return E_INVALIDARG;
153
154 int index = V_I4(&var);
155
156 if (index > m_count)
157 return S_OK;
158
159 BSTR name = NULL;
160
161 if(index == m_count)
162 {
164 }
165 else
166 {
167 MENUITEMINFOW info = { sizeof(info), 0 };
168 info.fMask = MIIM_STRING;
170 return E_FAIL;
172 if (name)
173 {
174 info.dwTypeData = name;
175 info.cch++;
177 }
178 }
179
180 if (!name)
181 return E_OUTOFMEMORY;
182
184 verb->Init(m_contextmenu, name);
185 verb->AddRef();
186 *ppid = verb;
187
188 return S_OK;
189}
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:727
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: