xref: /reactos/dll/win32/shell32/CCopyAsPathMenu.h (revision 4e5e72fa)
1 /*
2  * PROJECT:     ReactOS shell32
3  * LICENSE:     GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4  * PURPOSE:     Copy as Path Menu implementation
5  * COPYRIGHT:   Copyright 2024 Whindmar Saksit <whindsaks@proton.me>
6  *              Copyright 2024 Thamatip Chitpong <thamatip.chitpong@reactos.org>
7  */
8 
9 #pragma once
10 
11 class CCopyAsPathMenu :
12     public CComCoClass<CCopyAsPathMenu, &CLSID_CopyAsPathMenu>,
13     public CComObjectRootEx<CComMultiThreadModelNoCS>,
14     public IContextMenu,
15     public IShellExtInit
16 {
17 private:
18     CComPtr<IDataObject> m_pDataObject;
19 
20     HRESULT DoCopyAsPath(IDataObject *pdto);
21 
22 public:
23     CCopyAsPathMenu();
24     ~CCopyAsPathMenu();
25 
26     // IContextMenu
27     STDMETHODIMP QueryContextMenu(HMENU hMenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags) override;
28     STDMETHODIMP InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi) override;
29     STDMETHODIMP GetCommandString(UINT_PTR idCommand, UINT uFlags, UINT *lpReserved, LPSTR lpszName, UINT uMaxNameLen) override;
30 
31     // IShellExtInit
32     STDMETHODIMP Initialize(PCIDLIST_ABSOLUTE pidlFolder, IDataObject *pdtobj, HKEY hkeyProgID) override;
33 
34     DECLARE_REGISTRY_RESOURCEID(IDR_COPYASPATHMENU)
35     DECLARE_NOT_AGGREGATABLE(CCopyAsPathMenu)
36 
37     DECLARE_PROTECT_FINAL_CONSTRUCT()
38 
39     BEGIN_COM_MAP(CCopyAsPathMenu)
40         COM_INTERFACE_ENTRY_IID(IID_IContextMenu, IContextMenu)
41         COM_INTERFACE_ENTRY_IID(IID_IShellExtInit, IShellExtInit)
42     END_COM_MAP()
43 };
44