ReactOS 0.4.15-dev-8131-g4988de4
CCopyAsPathMenu Class Reference

#include <CCopyAsPathMenu.h>

Inheritance diagram for CCopyAsPathMenu:
Collaboration diagram for CCopyAsPathMenu:

Public Member Functions

 CCopyAsPathMenu ()
 
 ~CCopyAsPathMenu ()
 
STDMETHODIMP QueryContextMenu (HMENU hMenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags) override
 
STDMETHODIMP InvokeCommand (LPCMINVOKECOMMANDINFO lpcmi) override
 
STDMETHODIMP GetCommandString (UINT_PTR idCommand, UINT uFlags, UINT *lpReserved, LPSTR lpszName, UINT uMaxNameLen) override
 
STDMETHODIMP Initialize (PCIDLIST_ABSOLUTE pidlFolder, IDataObject *pdtobj, HKEY hkeyProgID) 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 ()
 
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 ()
 
HRESULT Initialize ([in] PCIDLIST_ABSOLUTE pidlFolder, [in] IDataObject *pdtobj, [in] HKEY hkeyProgID)
 

Private Member Functions

HRESULT DoCopyAsPath (IDataObject *pdto)
 

Private Attributes

CComPtr< IDataObjectm_pDataObject
 

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
 
- Public Types inherited from IShellExtInit
typedef IShellExtInitLPSHELLEXTINIT
 
- 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
 
- 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 11 of file CCopyAsPathMenu.h.

Constructor & Destructor Documentation

◆ CCopyAsPathMenu()

CCopyAsPathMenu::CCopyAsPathMenu ( )

Definition at line 15 of file CCopyAsPathMenu.cpp.

16{
17}

◆ ~CCopyAsPathMenu()

CCopyAsPathMenu::~CCopyAsPathMenu ( )

Definition at line 19 of file CCopyAsPathMenu.cpp.

20{
21}

Member Function Documentation

◆ DoCopyAsPath()

HRESULT CCopyAsPathMenu::DoCopyAsPath ( IDataObject pdto)
private

Definition at line 74 of file CCopyAsPathMenu.cpp.

75{
77 DWORD i, count;
78#if 0
81 if (SUCCEEDED(hr))
82 {
83 for (i = 0, array->GetCount(&count); i < count && SUCCEEDED(hr); ++i)
84 {
86 hr = array->GetItemAt(i, &item);
87 if (SUCCEEDED(hr))
88 {
90 hr = item->GetDisplayName(SIGDN_DESKTOPABSOLUTEPARSING, &path);
91 if (SUCCEEDED(hr))
92 {
94 }
95 }
96 }
97 }
98#else
99 FIXME("Implement and use SHCreateShellItemArrayFromDataObject\n");
100 CDataObjectHIDA pCIDA(pdto);
101 HRESULT hr = pCIDA.hr();
102 if (SUCCEEDED(hr))
103 {
104 for (i = 0, count = pCIDA->cidl; i < count && SUCCEEDED(hr); ++i)
105 {
109 hr = SHILCombine(folder, item, &full);
110 if (SUCCEEDED(hr))
111 {
115 if (SUCCEEDED(hr))
116 {
117 STRRET strret;
118 hr = sf->GetDisplayNameOf(child, SHGDN_FORPARSING, &strret);
119 if (SUCCEEDED(hr))
120 {
122 hr = StrRetToStrW(&strret, child, &path);
123 if (SUCCEEDED(hr))
124 {
126 }
127 }
128 }
129 }
130 }
131 }
132 else
133 {
134 FORMATETC fmte = { CF_HDROP, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
135 STGMEDIUM stgm;
136 hr = pdto->GetData(&fmte, &stgm);
137 if (SUCCEEDED(hr))
138 {
139 for (i = 0, count = DragQueryFileW((HDROP)stgm.hGlobal, -1, NULL, 0); i < count && SUCCEEDED(hr); ++i)
140 {
142 if (DragQueryFileW((HDROP)stgm.hGlobal, i, path, _countof(path)))
143 {
145 }
146 }
147 ReleaseStgMedium(&stgm);
148 }
149 }
150#endif
151
152 if (SUCCEEDED(hr))
153 {
156 }
157
158 return hr;
159}
static DWORD SetClipboardFromString(LPCWSTR str)
static void AppendToPathList(CStringW &paths, LPCWSTR path, DWORD index)
#define CF_HDROP
Definition: constants.h:410
#define FIXME(fmt,...)
Definition: debug.h:114
#define NULL
Definition: types.h:112
#define MAX_PATH
Definition: compat.h:34
void WINAPI ReleaseStgMedium(STGMEDIUM *pmedium)
Definition: ole2.c:2033
UINT WINAPI DragQueryFileW(HDROP hDrop, UINT lFile, LPWSTR lpszwFile, UINT lLength)
Definition: shellole.c:622
HRESULT WINAPI StrRetToStrW(LPSTRRET lpStrRet, const ITEMIDLIST *pidl, LPWSTR *ppszName)
Definition: string.c:1631
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLsizei const GLuint * paths
Definition: glext.h:11717
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
HRESULT GetData([in, unique] FORMATETC *pformatetcIn, [out] STGMEDIUM *pmedium)
#define SUCCEEDED(hr)
Definition: intsafe.h:50
static HWND child
Definition: cursoricon.c:298
static ATOM item
Definition: dde.c:856
HRESULT WINAPI SHBindToParent(LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppv, LPCITEMIDLIST *ppidlLast)
Definition: pidl.c:1350
#define err(...)
static PCUIDLIST_RELATIVE HIDA_GetPIDLItem(CIDA const *pida, SIZE_T i)
Definition: shellutils.h:589
static PCUIDLIST_ABSOLUTE HIDA_GetPIDLFolder(CIDA const *pida)
Definition: shellutils.h:584
HRESULT hr
Definition: shlfolder.c:183
HRESULT WINAPI SHCreateShellItemArrayFromDataObject(IDataObject *pdo, REFIID riid, void **ppv)
const ITEMIDLIST_ABSOLUTE UNALIGNED * PCUIDLIST_ABSOLUTE
Definition: shtypes.idl:63
const ITEMID_CHILD UNALIGNED * PCUITEMID_CHILD
Definition: shtypes.idl:70
const ITEMIDLIST_RELATIVE UNALIGNED * PCUIDLIST_RELATIVE
Definition: shtypes.idl:57
#define _countof(array)
Definition: sndvol32.h:70
Definition: fci.c:116
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
#define IID_PPV_ARG(Itype, ppType)
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by InvokeCommand().

◆ GetCommandString()

STDMETHODIMP CCopyAsPathMenu::GetCommandString ( UINT_PTR  idCommand,
UINT  uFlags,
UINT lpReserved,
LPSTR  lpszName,
UINT  uMaxNameLen 
)
override

Implements IContextMenu.

Definition at line 198 of file CCopyAsPathMenu.cpp.

199{
200 FIXME("CCopyAsPathMenu::GetCommandString(%p %lu %u %p %p %u)\n", this,
201 idCommand, uFlags, lpReserved, lpszName, uMaxNameLen);
202
203 return E_NOTIMPL;
204}
#define E_NOTIMPL
Definition: ddrawi.h:99
UINT uFlags
Definition: api.c:59

◆ Initialize()

STDMETHODIMP CCopyAsPathMenu::Initialize ( PCIDLIST_ABSOLUTE  pidlFolder,
IDataObject pdtobj,
HKEY  hkeyProgID 
)
override

Implements IShellExtInit.

Definition at line 207 of file CCopyAsPathMenu.cpp.

208{
209 m_pDataObject = pdtobj;
210 return S_OK;
211}
CComPtr< IDataObject > m_pDataObject
#define S_OK
Definition: intsafe.h:52

◆ InvokeCommand()

STDMETHODIMP CCopyAsPathMenu::InvokeCommand ( LPCMINVOKECOMMANDINFO  lpcmi)
override

Implements IContextMenu.

Definition at line 187 of file CCopyAsPathMenu.cpp.

188{
189 TRACE("CCopyAsPathMenu::InvokeCommand(%p %p)\n", this, lpcmi);
190
191 if (IS_INTRESOURCE(lpcmi->lpVerb) && LOWORD(lpcmi->lpVerb) == IDC_COPYASPATH)
193
194 return E_FAIL;
195}
#define IDC_COPYASPATH
HRESULT DoCopyAsPath(IDataObject *pdto)
#define E_FAIL
Definition: ddrawi.h:102
#define LOWORD(l)
Definition: pedump.c:82
#define TRACE(s)
Definition: solgame.cpp:4
#define IS_INTRESOURCE(i)
Definition: winuser.h:580

◆ QueryContextMenu()

STDMETHODIMP CCopyAsPathMenu::QueryContextMenu ( HMENU  hMenu,
UINT  indexMenu,
UINT  idCmdFirst,
UINT  idCmdLast,
UINT  uFlags 
)
override

Implements IContextMenu.

Definition at line 162 of file CCopyAsPathMenu.cpp.

163{
164 MENUITEMINFOW mii;
165
166 TRACE("CCopyAsPathMenu::QueryContextMenu(%p %p %u %u %u %u)\n", this,
167 hMenu, indexMenu, idCmdFirst, idCmdLast, uFlags);
168
169 if ((uFlags & CMF_NOVERBS) || !(uFlags & CMF_EXTENDEDVERBS))
170 return MAKE_HRESULT(SEVERITY_SUCCESS, 0, idCmdFirst);
171
172 // Insert "Copy as path"
174 ZeroMemory(&mii, sizeof(mii));
175 mii.cbSize = sizeof(mii);
176 mii.fMask = MIIM_ID | MIIM_TYPE;
177 mii.fType = MFT_STRING;
178 mii.wID = idCmdFirst + IDC_COPYASPATH;
179 mii.dwTypeData = strText.GetBuffer();
180 if (InsertMenuItemW(hMenu, indexMenu, TRUE, &mii))
181 return MAKE_HRESULT(SEVERITY_SUCCESS, 0, mii.wID - idCmdFirst + 1);
182
183 return MAKE_HRESULT(SEVERITY_SUCCESS, 0, idCmdFirst);
184}
#define TRUE
Definition: types.h:120
#define MAKE_HRESULT(sev, fac, code)
Definition: dmerror.h:30
#define IDS_COPYASPATHMENU
Definition: shresdef.h:248
LPWSTR dwTypeData
Definition: winuser.h:3269
#define ZeroMemory
Definition: winbase.h:1712
#define SEVERITY_SUCCESS
Definition: winerror.h:64
#define MIIM_ID
Definition: winuser.h:722
#define MFT_STRING
Definition: winuser.h:746
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define MIIM_TYPE
Definition: winuser.h:725
BOOL WINAPI InsertMenuItemW(_In_ HMENU, _In_ UINT, _In_ BOOL, _In_ LPCMENUITEMINFOW)

Member Data Documentation

◆ m_pDataObject

CComPtr<IDataObject> CCopyAsPathMenu::m_pDataObject
private

Definition at line 18 of file CCopyAsPathMenu.h.

Referenced by Initialize(), and InvokeCommand().


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