ReactOS 0.4.15-dev-8135-g1bc6c90
CCopyToMenu Class Reference

#include <CCopyMoveToMenu.h>

Inheritance diagram for CCopyToMenu:
Collaboration diagram for CCopyToMenu:

Public Member Functions

 CCopyToMenu ()
 
STDMETHODIMP QueryContextMenu (HMENU hMenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags) override
 
UINT GetCaptionStringID () const override
 
UINT GetButtonStringID () const override
 
UINT GetActionTitleStringID () const override
 
UINT GetFileOp () const override
 
LPCSTR GetVerb () const override
 
- Public Member Functions inherited from CCopyMoveToMenu
 CCopyMoveToMenu ()
 
virtual UINT GetCaptionStringID () const =0
 
virtual UINT GetButtonStringID () const =0
 
virtual UINT GetActionTitleStringID () const =0
 
virtual UINT GetFileOp () const =0
 
virtual LPCSTR GetVerb () const =0
 
STDMETHODIMP GetCommandString (UINT_PTR idCommand, UINT uFlags, UINT *lpReserved, LPSTR lpszName, UINT uMaxNameLen) override
 
STDMETHODIMP InvokeCommand (LPCMINVOKECOMMANDINFO lpcmi) override
 
STDMETHODIMP HandleMenuMsg (UINT uMsg, WPARAM wParam, LPARAM lParam) override
 
STDMETHODIMP Initialize (PCIDLIST_ABSOLUTE pidlFolder, IDataObject *pdtobj, HKEY hkeyProgID) override
 
STDMETHODIMP SetSite (IUnknown *pUnkSite) override
 
STDMETHODIMP GetSite (REFIID riid, void **ppvSite) 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 HandleMenuMsg ([in] UINT uMsg, [in] WPARAM wParam, [in] LPARAM lParam)
 
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 IObjectWithSite
HRESULT SetSite ([in] IUnknown *pUnkSite)
 
HRESULT GetSite ([in] REFIID riid, [out, iid_is(riid)] PVOID *ppvSite)
 
HRESULT Initialize ([in] PCIDLIST_ABSOLUTE pidlFolder, [in] IDataObject *pdtobj, [in] HKEY hkeyProgID)
 

Public Attributes

CComHeapPtr< ITEMIDLISTm_pidlFolder
 
WNDPROC m_fnOldWndProc
 
BOOL m_bIgnoreTextBoxChange
 
- Public Attributes inherited from CCopyMoveToMenu
CComHeapPtr< ITEMIDLISTm_pidlFolder
 
WNDPROC m_fnOldWndProc
 
BOOL m_bIgnoreTextBoxChange
 
- Public Attributes inherited from ATL::CComObjectRootBase
LONG m_dwRef
 

Additional Inherited Members

- Public Types inherited from IContextMenu2
typedef IContextMenu2LPCONTEXTMENU2
 
- 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 IObjectWithSite
typedef IObjectWithSiteLPOBJECTWITHSITE
 
- 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)
 
- 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}
 
- Protected Member Functions inherited from CCopyMoveToMenu
HRESULT DoRealFileOp (LPCMINVOKECOMMANDINFO lpici, PCUIDLIST_ABSOLUTE pidl)
 
HRESULT DoAction (LPCMINVOKECOMMANDINFO lpici)
 
- Protected Attributes inherited from CCopyMoveToMenu
UINT m_idCmdFirst
 
UINT m_idCmdLast
 
UINT m_idCmdAction
 
CComPtr< IDataObjectm_pDataObject
 
CComPtr< IUnknownm_pSite
 

Detailed Description

Definition at line 51 of file CCopyMoveToMenu.h.

Constructor & Destructor Documentation

◆ CCopyToMenu()

CCopyToMenu::CCopyToMenu ( )
inline

Definition at line 60 of file CCopyMoveToMenu.h.

60{ }

Member Function Documentation

◆ GetActionTitleStringID()

UINT CCopyToMenu::GetActionTitleStringID ( ) const
inlineoverridevirtual

Implements CCopyMoveToMenu.

Definition at line 79 of file CCopyMoveToMenu.h.

79{ return IDS_COPYTOTITLE; }
#define IDS_COPYTOTITLE
Definition: shresdef.h:342

◆ GetButtonStringID()

UINT CCopyToMenu::GetButtonStringID ( ) const
inlineoverridevirtual

Implements CCopyMoveToMenu.

Definition at line 78 of file CCopyMoveToMenu.h.

78{ return IDS_COPYBUTTON; }
#define IDS_COPYBUTTON
Definition: shresdef.h:344

◆ GetCaptionStringID()

UINT CCopyToMenu::GetCaptionStringID ( ) const
inlineoverridevirtual

Implements CCopyMoveToMenu.

Definition at line 77 of file CCopyMoveToMenu.h.

77{ return IDS_COPYITEMS; }
#define IDS_COPYITEMS
Definition: shresdef.h:343

◆ GetFileOp()

UINT CCopyToMenu::GetFileOp ( ) const
inlineoverridevirtual

Implements CCopyMoveToMenu.

Definition at line 80 of file CCopyMoveToMenu.h.

80{ return FO_COPY; }
#define FO_COPY
Definition: shellapi.h:137

◆ GetVerb()

LPCSTR CCopyToMenu::GetVerb ( ) const
inlineoverridevirtual

Implements CCopyMoveToMenu.

Definition at line 81 of file CCopyMoveToMenu.h.

81{ return "copyto"; }

◆ QueryContextMenu()

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

Implements IContextMenu.

Definition at line 276 of file CCopyMoveToMenu.cpp.

281{
282 MENUITEMINFOW mii;
283 UINT Count = 0;
284
285 TRACE("CCopyToMenu::QueryContextMenu(%p, %u, %u, %u, %u)\n",
286 hMenu, indexMenu, idCmdFirst, idCmdLast, uFlags);
287
288 if (uFlags & (CMF_NOVERBS | CMF_VERBSONLY))
289 return MAKE_HRESULT(SEVERITY_SUCCESS, 0, idCmdFirst);
290
291 m_idCmdFirst = m_idCmdLast = idCmdFirst;
292
293 // insert separator if necessary
294 ZeroMemory(&mii, sizeof(mii));
295 mii.cbSize = sizeof(mii);
296 mii.fMask = MIIM_TYPE;
297 if (GetPreviousMenuItemInfo(hMenu, indexMenu, &mii) &&
298 mii.fType != MFT_SEPARATOR)
299 {
300 ZeroMemory(&mii, sizeof(mii));
301 mii.cbSize = sizeof(mii);
302 mii.fMask = MIIM_TYPE;
303 mii.fType = MFT_SEPARATOR;
304 if (InsertMenuItemW(hMenu, indexMenu, TRUE, &mii))
305 {
306 ++indexMenu;
307 ++Count;
308 }
309 }
310
311 // insert "Copy to folder..."
313 ZeroMemory(&mii, sizeof(mii));
314 mii.cbSize = sizeof(mii);
315 mii.fMask = MIIM_ID | MIIM_TYPE;
316 mii.fType = MFT_STRING;
317 mii.dwTypeData = strText.GetBuffer();
318 mii.cch = wcslen(mii.dwTypeData);
319 mii.wID = m_idCmdLast;
320 if (InsertMenuItemW(hMenu, indexMenu, TRUE, &mii))
321 {
323 ++indexMenu;
324 ++Count;
325 }
326
327 return MAKE_HRESULT(SEVERITY_SUCCESS, 0, idCmdFirst + Count);
328}
static BOOL GetPreviousMenuItemInfo(HMENU hMenu, UINT iItem, LPMENUITEMINFOW lpmii)
#define TRUE
Definition: types.h:120
UINT uFlags
Definition: api.c:59
#define MAKE_HRESULT(sev, fac, code)
Definition: dmerror.h:30
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
unsigned int UINT
Definition: ndis.h:50
int Count
Definition: noreturn.cpp:7
#define IDS_COPYTOMENU
Definition: shresdef.h:341
#define TRACE(s)
Definition: solgame.cpp:4
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_SEPARATOR
Definition: winuser.h:744
#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_bIgnoreTextBoxChange

BOOL CCopyToMenu::m_bIgnoreTextBoxChange

Definition at line 58 of file CCopyMoveToMenu.h.

◆ m_fnOldWndProc

WNDPROC CCopyToMenu::m_fnOldWndProc

Definition at line 57 of file CCopyMoveToMenu.h.

◆ m_pidlFolder

CComHeapPtr<ITEMIDLIST> CCopyToMenu::m_pidlFolder

Definition at line 56 of file CCopyMoveToMenu.h.


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