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