ReactOS 0.4.16-dev-109-gf4cb10f
CSendToMenu.h
Go to the documentation of this file.
1/*
2 * provides new shell item service
3 *
4 * Copyright 2019 Katayama Hirofumi MZ.
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 */
20
21#ifndef _SHV_ITEM_SENDTO_H_
22#define _SHV_ITEM_SENDTO_H_
23
24extern "C" const GUID CLSID_SendToMenu;
25
27 public CComCoClass<CSendToMenu, &CLSID_SendToMenu>,
28 public CComObjectRootEx<CComMultiThreadModelNoCS>,
29 public IContextMenu3,
30 public IShellExtInit
31{
32private:
34 {
39
41 : pNext(NULL)
43 , pszText(text)
44 , hIcon(icon)
45 {
46 }
47
49 {
53 }
54
55 private:
59 };
60
64
65 CComPtr<IShellFolder> m_pDesktop;
66 CComPtr<IShellFolder> m_pSendTo;
67 CComPtr<IDataObject> m_pDataObject;
68
70 void UnloadAllItems();
71
72 UINT InsertSendToItems(HMENU hMenu, UINT idFirst, UINT idMenu);
73
76
77 HRESULT DoDrop(IDataObject *pDataObject, IDropTarget *pDropTarget);
78 HRESULT GetSpecialFolder(HWND hwnd, IShellFolder **ppFolder, int csidl,
79 PIDLIST_ABSOLUTE *ppidl = NULL);
81
82public:
85
86 // IContextMenu
87 STDMETHODIMP QueryContextMenu(HMENU hMenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags);
89 STDMETHODIMP GetCommandString(UINT_PTR idCommand, UINT uFlags, UINT *lpReserved, LPSTR lpszName, UINT uMaxNameLen);
90
91 // IContextMenu3
93
94 // IContextMenu2
96
97 // IShellExtInit
98 STDMETHODIMP Initialize(PCIDLIST_ABSOLUTE pidlFolder, IDataObject *pdtobj, HKEY hkeyProgID);
99
103
105 COM_INTERFACE_ENTRY_IID(IID_IContextMenu3, IContextMenu3)
106 COM_INTERFACE_ENTRY_IID(IID_IContextMenu2, IContextMenu2)
107 COM_INTERFACE_ENTRY_IID(IID_IContextMenu, IContextMenu)
108 COM_INTERFACE_ENTRY_IID(IID_IShellExtInit, IShellExtInit)
110};
111
112#endif /* _SHV_ITEM_SENDTO_H_ */
const GUID CLSID_SendToMenu
Definition: CSendToMenu.h:24
#define STDMETHODIMP
Definition: basetyps.h:43
SENDTO_ITEM * FindItemFromIdOffset(UINT IdOffset)
HRESULT GetUIObjectFromPidl(HWND hwnd, PIDLIST_ABSOLUTE pidl, REFIID riid, LPVOID *ppvOut)
SENDTO_ITEM * m_pItems
Definition: CSendToMenu.h:62
CComPtr< IShellFolder > m_pSendTo
Definition: CSendToMenu.h:66
UINT InsertSendToItems(HMENU hMenu, UINT idFirst, UINT idMenu)
HRESULT LoadAllItems(HWND hwnd)
CComPtr< IShellFolder > m_pDesktop
Definition: CSendToMenu.h:65
void UnloadAllItems()
HRESULT GetSpecialFolder(HWND hwnd, IShellFolder **ppFolder, int csidl, PIDLIST_ABSOLUTE *ppidl=NULL)
STDMETHODIMP QueryContextMenu(HMENU hMenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags)
HMENU m_hSubMenu
Definition: CSendToMenu.h:61
STDMETHODIMP HandleMenuMsg(UINT uMsg, WPARAM wParam, LPARAM lParam)
STDMETHODIMP HandleMenuMsg2(UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *plResult)
STDMETHODIMP GetCommandString(UINT_PTR idCommand, UINT uFlags, UINT *lpReserved, LPSTR lpszName, UINT uMaxNameLen)
HRESULT DoSendToItem(SENDTO_ITEM *pItem, LPCMINVOKECOMMANDINFO lpici)
HRESULT DoDrop(IDataObject *pDataObject, IDropTarget *pDropTarget)
Definition: CSendToMenu.cpp:50
CComPtr< IDataObject > m_pDataObject
Definition: CSendToMenu.h:67
STDMETHODIMP InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi)
UINT m_idCmdFirst
Definition: CSendToMenu.h:63
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define NULL
Definition: types.h:112
UINT uFlags
Definition: api.c:59
const WCHAR * text
Definition: package.c:1794
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
REFIID riid
Definition: atlbase.h:39
#define BEGIN_COM_MAP(x)
Definition: atlcom.h:581
#define COM_INTERFACE_ENTRY_IID(iid, x)
Definition: atlcom.h:601
#define DECLARE_PROTECT_FINAL_CONSTRUCT()
Definition: atlcom.h:679
#define DECLARE_NOT_AGGREGATABLE(x)
Definition: atlcom.h:651
#define DECLARE_REGISTRY_RESOURCEID(x)
Definition: atlcom.h:645
#define END_COM_MAP()
Definition: atlcom.h:592
static HICON
Definition: imagelist.c:80
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
static HWND child
Definition: cursoricon.c:298
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
unsigned int UINT
Definition: ndis.h:50
#define REFIID
Definition: guiddef.h:118
#define IDR_SENDTOMENU
Definition: shresdef.h:914
PITEMID_CHILD pidlChild
Definition: CSendToMenu.h:36
SENDTO_ITEM(const SENDTO_ITEM &)
SENDTO_ITEM & operator=(const SENDTO_ITEM &)
SENDTO_ITEM(PITEMID_CHILD child, LPWSTR text, HICON icon)
Definition: CSendToMenu.h:40
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2105
static void Initialize()
Definition: xlate.c:212
char * LPSTR
Definition: xmlstorage.h:182
WCHAR * LPWSTR
Definition: xmlstorage.h:184