ReactOS  0.4.15-dev-1397-g19779b3
CCopyToMoveToMenu.h
Go to the documentation of this file.
1 /*
2  * PROJECT: shell32
3  * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4  * PURPOSE: CopyTo and MoveTo implementation
5  * COPYRIGHT: Copyright 2020 Katayama Hirofumi MZ (katayama.hirofumi.mz@gmail.com)
6  */
7 #pragma once
8 
9 HRESULT _GetCidlFromDataObject(IDataObject *pDataObject, CIDA** ppcida);
10 
11 class CCopyToMenu :
12  public CComCoClass<CCopyToMenu, &CLSID_CopyToMenu>,
13  public CComObjectRootEx<CComMultiThreadModelNoCS>,
14  public IContextMenu2,
15  public IObjectWithSite,
16  public IShellExtInit
17 {
18 protected:
20  CComPtr<IDataObject> m_pDataObject;
21  CComPtr<IUnknown> m_pSite;
22 
26 
27 public:
28  CComHeapPtr<ITEMIDLIST> m_pidlFolder;
31 
32  CCopyToMenu();
33  ~CCopyToMenu();
34 
35  // IContextMenu
36  virtual HRESULT WINAPI QueryContextMenu(HMENU hMenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags);
38  virtual HRESULT WINAPI GetCommandString(UINT_PTR idCommand, UINT uFlags, UINT *lpReserved, LPSTR lpszName, UINT uMaxNameLen);
39 
40  // IContextMenu2
42 
43  // IShellExtInit
44  virtual HRESULT WINAPI Initialize(PCIDLIST_ABSOLUTE pidlFolder, IDataObject *pdtobj, HKEY hkeyProgID);
45 
46  // IObjectWithSite
47  virtual HRESULT WINAPI SetSite(IUnknown *pUnkSite);
48  virtual HRESULT WINAPI GetSite(REFIID riid, void **ppvSite);
49 
52 
54 
56  COM_INTERFACE_ENTRY_IID(IID_IContextMenu2, IContextMenu2)
57  COM_INTERFACE_ENTRY_IID(IID_IContextMenu, IContextMenu)
58  COM_INTERFACE_ENTRY_IID(IID_IShellExtInit, IShellExtInit)
60  END_COM_MAP()
61 };
62 
64  public CComCoClass<CMoveToMenu, &CLSID_MoveToMenu>,
65  public CComObjectRootEx<CComMultiThreadModelNoCS>,
66  public IContextMenu2,
67  public IObjectWithSite,
68  public IShellExtInit
69 {
70 protected:
72  CComPtr<IDataObject> m_pDataObject;
73  CComPtr<IUnknown> m_pSite;
74 
75  HRESULT DoMoveToFolder(LPCMINVOKECOMMANDINFO lpici);
76  HRESULT DoRealMove(LPCMINVOKECOMMANDINFO lpici, PCUIDLIST_ABSOLUTE pidl);
78 
79 public:
80  CComHeapPtr<ITEMIDLIST> m_pidlFolder;
83 
84  CMoveToMenu();
85  ~CMoveToMenu();
86 
87  // IContextMenu
88  virtual HRESULT WINAPI QueryContextMenu(HMENU hMenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags);
90  virtual HRESULT WINAPI GetCommandString(UINT_PTR idCommand, UINT uFlags, UINT *lpReserved, LPSTR lpszName, UINT uMaxNameLen);
91 
92  // IContextMenu2
94 
95  // IShellExtInit
96  virtual HRESULT WINAPI Initialize(PCIDLIST_ABSOLUTE pidlFolder, IDataObject *pdtobj, HKEY hkeyProgID);
97 
98  // IObjectWithSite
99  virtual HRESULT WINAPI SetSite(IUnknown *pUnkSite);
100  virtual HRESULT WINAPI GetSite(REFIID riid, void **ppvSite);
101 
104 
106 
108  COM_INTERFACE_ENTRY_IID(IID_IContextMenu2, IContextMenu2)
109  COM_INTERFACE_ENTRY_IID(IID_IContextMenu, IContextMenu)
110  COM_INTERFACE_ENTRY_IID(IID_IShellExtInit, IShellExtInit)
112  END_COM_MAP()
113 };
HRESULT _GetCidlFromDataObject(IDataObject *pDataObject, CIDA **ppcida)
Definition: CFontMenu.cpp:14
#define REFIID
Definition: guiddef.h:118
BOOL m_bIgnoreTextBoxChange
REFIID riid
Definition: precomp.h:44
#define IDR_COPYTOMENU
Definition: shresdef.h:853
CComHeapPtr< ITEMIDLIST > m_pidlFolder
#define DECLARE_NOT_AGGREGATABLE(x)
Definition: atlcom.h:611
CComHeapPtr< ITEMIDLIST > m_pidlFolder
UINT_PTR WPARAM
Definition: windef.h:207
virtual HRESULT WINAPI GetCommandString(UINT_PTR idCommand, UINT uFlags, UINT *lpReserved, LPSTR lpszName, UINT uMaxNameLen)
UINT uFlags
Definition: api.c:59
char * LPSTR
Definition: xmlstorage.h:182
WPARAM wParam
Definition: combotst.c:138
CComPtr< IUnknown > m_pSite
virtual HRESULT WINAPI QueryContextMenu(HMENU hMenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags)
unsigned int BOOL
Definition: ntddk_ex.h:94
CComPtr< IDataObject > m_pDataObject
CStringW DoGetFileTitle()
WNDPROC m_fnOldWndProc
LONG_PTR LPARAM
Definition: windef.h:208
HRESULT DoRealCopy(LPCMINVOKECOMMANDINFO lpici, PCUIDLIST_ABSOLUTE pidl)
CComPtr< IDataObject > m_pDataObject
virtual HRESULT WINAPI SetSite(IUnknown *pUnkSite)
#define BEGIN_COM_MAP(x)
Definition: atlcom.h:541
virtual HRESULT WINAPI InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi)
LONG HRESULT
Definition: typedefs.h:79
CComPtr< IUnknown > m_pSite
virtual HRESULT WINAPI HandleMenuMsg(UINT uMsg, WPARAM wParam, LPARAM lParam)
#define WINAPI
Definition: msvc.h:6
const IID IID_IObjectWithSite
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
virtual HRESULT WINAPI Initialize(PCIDLIST_ABSOLUTE pidlFolder, IDataObject *pdtobj, HKEY hkeyProgID)
#define DECLARE_REGISTRY_RESOURCEID(x)
Definition: atlcom.h:605
BOOL m_bIgnoreTextBoxChange
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2881
HRESULT DoCopyToFolder(LPCMINVOKECOMMANDINFO lpici)
#define IDR_MOVETOMENU
Definition: shresdef.h:854
const ITEMIDLIST_ABSOLUTE UNALIGNED * PCUIDLIST_ABSOLUTE
Definition: shtypes.idl:63
WNDPROC m_fnOldWndProc
#define COM_INTERFACE_ENTRY_IID(iid, x)
Definition: atlcom.h:561
unsigned int UINT
Definition: ndis.h:50
#define DECLARE_PROTECT_FINAL_CONSTRUCT()
Definition: atlcom.h:639
const WCHAR * class
Definition: main.c:68
CAtlStringW CStringW
Definition: atlstr.h:130
#define END_COM_MAP()
Definition: atlcom.h:552
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
virtual HRESULT WINAPI GetSite(REFIID riid, void **ppvSite)
LPARAM lParam
Definition: combotst.c:139
Definition: shlobj.h:498