ReactOS 0.4.15-dev-8102-g108db8f
CMoveToMenu Class Reference

#include <CCopyMoveToMenu.h>

Inheritance diagram for CMoveToMenu:
Collaboration diagram for CMoveToMenu:

Public Member Functions

 CMoveToMenu ()
 
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)
 

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)
 
- Public Attributes inherited from CCopyMoveToMenu
CComHeapPtr< ITEMIDLISTm_pidlFolder
 
WNDPROC m_fnOldWndProc
 
BOOL m_bIgnoreTextBoxChange
 
- 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}
 
- 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 84 of file CCopyMoveToMenu.h.

Constructor & Destructor Documentation

◆ CMoveToMenu()

CMoveToMenu::CMoveToMenu ( )
inline

Definition at line 89 of file CCopyMoveToMenu.h.

89{ }

Member Function Documentation

◆ GetActionTitleStringID()

UINT CMoveToMenu::GetActionTitleStringID ( ) const
inlineoverridevirtual

Implements CCopyMoveToMenu.

Definition at line 108 of file CCopyMoveToMenu.h.

108{ return IDS_MOVETOTITLE; }
#define IDS_MOVETOTITLE
Definition: shresdef.h:346

◆ GetButtonStringID()

UINT CMoveToMenu::GetButtonStringID ( ) const
inlineoverridevirtual

Implements CCopyMoveToMenu.

Definition at line 107 of file CCopyMoveToMenu.h.

107{ return IDS_MOVEBUTTON; }
#define IDS_MOVEBUTTON
Definition: shresdef.h:348

◆ GetCaptionStringID()

UINT CMoveToMenu::GetCaptionStringID ( ) const
inlineoverridevirtual

Implements CCopyMoveToMenu.

Definition at line 106 of file CCopyMoveToMenu.h.

106{ return IDS_MOVEITEMS; }
#define IDS_MOVEITEMS
Definition: shresdef.h:347

◆ GetFileOp()

UINT CMoveToMenu::GetFileOp ( ) const
inlineoverridevirtual

Implements CCopyMoveToMenu.

Definition at line 109 of file CCopyMoveToMenu.h.

109{ return FO_MOVE; }
#define FO_MOVE
Definition: shellapi.h:136

◆ GetVerb()

LPCSTR CMoveToMenu::GetVerb ( ) const
inlineoverridevirtual

Implements CCopyMoveToMenu.

Definition at line 110 of file CCopyMoveToMenu.h.

110{ return "moveto"; }

◆ QueryContextMenu()

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

Implements IContextMenu.

Definition at line 331 of file CCopyMoveToMenu.cpp.

336{
337 MENUITEMINFOW mii;
338 UINT Count = 0;
339
340 TRACE("CMoveToMenu::QueryContextMenu(%p, %u, %u, %u, %u)\n",
341 hMenu, indexMenu, idCmdFirst, idCmdLast, uFlags);
342
343 if (uFlags & (CMF_NOVERBS | CMF_VERBSONLY))
344 return MAKE_HRESULT(SEVERITY_SUCCESS, 0, idCmdFirst);
345
346 m_idCmdFirst = m_idCmdLast = idCmdFirst;
347
348 // insert separator if necessary
350 WCHAR szBuff[128];
351 ZeroMemory(&mii, sizeof(mii));
352 mii.cbSize = sizeof(mii);
353 mii.fMask = MIIM_TYPE;
354 mii.dwTypeData = szBuff;
355 mii.cch = _countof(szBuff);
356 if (GetPreviousMenuItemInfo(hMenu, indexMenu, &mii) &&
357 mii.fType != MFT_SEPARATOR &&
358 !(mii.fType == MFT_STRING && CStringW(szBuff) == strCopyTo))
359 {
360 ZeroMemory(&mii, sizeof(mii));
361 mii.cbSize = sizeof(mii);
362 mii.fMask = MIIM_TYPE;
363 mii.fType = MFT_SEPARATOR;
364 if (InsertMenuItemW(hMenu, indexMenu, TRUE, &mii))
365 {
366 ++indexMenu;
367 ++Count;
368 }
369 }
370
371 // insert "Move to folder..."
373 ZeroMemory(&mii, sizeof(mii));
374 mii.cbSize = sizeof(mii);
375 mii.fMask = MIIM_ID | MIIM_TYPE;
376 mii.fType = MFT_STRING;
377 mii.dwTypeData = strText.GetBuffer();
378 mii.cch = wcslen(mii.dwTypeData);
379 mii.wID = m_idCmdLast;
380 if (InsertMenuItemW(hMenu, indexMenu, TRUE, &mii))
381 {
383 ++indexMenu;
384 ++Count;
385 }
386
387 return MAKE_HRESULT(SEVERITY_SUCCESS, 0, idCmdFirst + Count);
388}
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_MOVETOMENU
Definition: shresdef.h:345
#define IDS_COPYTOMENU
Definition: shresdef.h:341
#define _countof(array)
Definition: sndvol32.h:70
#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)
__wchar_t WCHAR
Definition: xmlstorage.h:180

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