ReactOS  0.4.15-dev-4927-gfe8f806
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 
10 class CCopyToMenu :
11  public CComCoClass<CCopyToMenu, &CLSID_CopyToMenu>,
12  public CComObjectRootEx<CComMultiThreadModelNoCS>,
13  public IContextMenu2,
14  public IObjectWithSite,
15  public IShellExtInit
16 {
17 protected:
19  CComPtr<IDataObject> m_pDataObject;
20  CComPtr<IUnknown> m_pSite;
21 
25 
26 public:
27  CComHeapPtr<ITEMIDLIST> m_pidlFolder;
30 
31  CCopyToMenu();
32  ~CCopyToMenu();
33 
34  // IContextMenu
35  virtual HRESULT WINAPI QueryContextMenu(HMENU hMenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags);
37  virtual HRESULT WINAPI GetCommandString(UINT_PTR idCommand, UINT uFlags, UINT *lpReserved, LPSTR lpszName, UINT uMaxNameLen);
38 
39  // IContextMenu2
41 
42  // IShellExtInit
43  virtual HRESULT WINAPI Initialize(PCIDLIST_ABSOLUTE pidlFolder, IDataObject *pdtobj, HKEY hkeyProgID);
44 
45  // IObjectWithSite
46  virtual HRESULT WINAPI SetSite(IUnknown *pUnkSite);
47  virtual HRESULT WINAPI GetSite(REFIID riid, void **ppvSite);
48 
51 
53 
55  COM_INTERFACE_ENTRY_IID(IID_IContextMenu2, IContextMenu2)
56  COM_INTERFACE_ENTRY_IID(IID_IContextMenu, IContextMenu)
57  COM_INTERFACE_ENTRY_IID(IID_IShellExtInit, IShellExtInit)
59  END_COM_MAP()
60 };
61 
63  public CComCoClass<CMoveToMenu, &CLSID_MoveToMenu>,
64  public CComObjectRootEx<CComMultiThreadModelNoCS>,
65  public IContextMenu2,
66  public IObjectWithSite,
67  public IShellExtInit
68 {
69 protected:
71  CComPtr<IDataObject> m_pDataObject;
72  CComPtr<IUnknown> m_pSite;
73 
74  HRESULT DoMoveToFolder(LPCMINVOKECOMMANDINFO lpici);
75  HRESULT DoRealMove(LPCMINVOKECOMMANDINFO lpici, PCUIDLIST_ABSOLUTE pidl);
77 
78 public:
79  CComHeapPtr<ITEMIDLIST> m_pidlFolder;
82 
83  CMoveToMenu();
84  ~CMoveToMenu();
85 
86  // IContextMenu
87  virtual HRESULT WINAPI QueryContextMenu(HMENU hMenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags);
89  virtual HRESULT WINAPI GetCommandString(UINT_PTR idCommand, UINT uFlags, UINT *lpReserved, LPSTR lpszName, UINT uMaxNameLen);
90 
91  // IContextMenu2
93 
94  // IShellExtInit
95  virtual HRESULT WINAPI Initialize(PCIDLIST_ABSOLUTE pidlFolder, IDataObject *pdtobj, HKEY hkeyProgID);
96 
97  // IObjectWithSite
98  virtual HRESULT WINAPI SetSite(IUnknown *pUnkSite);
99  virtual HRESULT WINAPI GetSite(REFIID riid, void **ppvSite);
100 
103 
105 
107  COM_INTERFACE_ENTRY_IID(IID_IContextMenu2, IContextMenu2)
108  COM_INTERFACE_ENTRY_IID(IID_IContextMenu, IContextMenu)
109  COM_INTERFACE_ENTRY_IID(IID_IShellExtInit, IShellExtInit)
111  END_COM_MAP()
112 };
#define REFIID
Definition: guiddef.h:118
BOOL m_bIgnoreTextBoxChange
REFIID riid
Definition: precomp.h:44
#define IDR_COPYTOMENU
Definition: shresdef.h:880
CComHeapPtr< ITEMIDLIST > m_pidlFolder
#define DECLARE_NOT_AGGREGATABLE(x)
Definition: atlcom.h:612
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:542
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:606
BOOL m_bIgnoreTextBoxChange
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2886
HRESULT DoCopyToFolder(LPCMINVOKECOMMANDINFO lpici)
#define IDR_MOVETOMENU
Definition: shresdef.h:881
const ITEMIDLIST_ABSOLUTE UNALIGNED * PCUIDLIST_ABSOLUTE
Definition: shtypes.idl:63
WNDPROC m_fnOldWndProc
#define COM_INTERFACE_ENTRY_IID(iid, x)
Definition: atlcom.h:562
unsigned int UINT
Definition: ndis.h:50
#define DECLARE_PROTECT_FINAL_CONSTRUCT()
Definition: atlcom.h:640
const WCHAR * class
Definition: main.c:68
CAtlStringW CStringW
Definition: atlstr.h:130
#define END_COM_MAP()
Definition: atlcom.h:553
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