ReactOS  0.4.15-dev-1068-g467feb9
CSendToZip.hpp
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS Zip Shell Extension
3  * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4  * PURPOSE: SendTo handler
5  * COPYRIGHT: Copyright 2019 Mark Jansen (mark.jansen@reactos.org)
6  * Copyright 2019 Katayama Hirofumi MZ (katayama.hirofumi.mz@gmail.com)
7  */
8 
9 #ifndef CSENDTOZIP_HPP_
10 #define CSENDTOZIP_HPP_
11 
12 class CSendToZip :
13  public CComCoClass<CSendToZip, &CLSID_ZipFolderSendTo>,
14  public CComObjectRootEx<CComMultiThreadModelNoCS>,
15  public IDropTarget,
16  public IPersistFile
17 {
18  CComPtr<IDataObject> m_pDataObject;
20 
21 public:
23  {
25  }
26 
27  virtual ~CSendToZip()
28  {
30  }
31 
32  // *** IShellFolder2 methods ***
33  STDMETHODIMP DragEnter(IDataObject *pDataObj, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect);
34  STDMETHODIMP DragOver(DWORD grfKeyState, POINTL pt, DWORD *pdwEffect);
36  STDMETHODIMP Drop(IDataObject *pDataObj, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect);
37 
38  // *** IPersistFile methods ***
40  {
41  return S_FALSE;
42  }
43  STDMETHODIMP Load(LPCOLESTR pszFileName, DWORD dwMode)
44  {
45  return S_OK;
46  }
47  STDMETHODIMP Save(LPCOLESTR pszFileName, BOOL fRemember)
48  {
49  return E_NOTIMPL;
50  }
52  {
53  return E_NOTIMPL;
54  }
56  {
57  return E_NOTIMPL;
58  }
59 
60  // *** IPersist methods ***
62  {
63  *pclsid = CLSID_ZipFolderSendTo;
64  return S_OK;
65  }
66 
67 public:
68  DECLARE_NO_REGISTRY() // Handled manually
70 
72 
74  COM_INTERFACE_ENTRY_IID(IID_IDropTarget, IDropTarget)
77  END_COM_MAP()
78 };
79 
80 #endif
virtual ~CSendToZip()
Definition: CSendToZip.hpp:27
STDMETHODIMP GetCurFile(LPOLESTR *ppszFileName)
Definition: CSendToZip.hpp:55
STDMETHODIMP DragEnter(IDataObject *pDataObj, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect)
Definition: CSendToZip.cpp:12
#define pt(x, y)
Definition: drawing.c:79
LONG g_ModuleRefCnt
Definition: ACPPage.cpp:13
const GUID IID_IPersist
Definition: proxy.cpp:14
BOOL m_fCanDragDrop
Definition: CSendToZip.hpp:19
#define DECLARE_NOT_AGGREGATABLE(x)
Definition: atlcom.h:611
#define DECLARE_NO_REGISTRY()
Definition: atlcom.h:599
static LPOLESTR
Definition: stg_prop.c:27
STDMETHODIMP IsDirty()
Definition: CSendToZip.hpp:39
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
WORD WORD PSZ PSZ pszFileName
Definition: vdmdbg.h:41
#define STDMETHODIMP
Definition: basetyps.h:43
#define S_FALSE
Definition: winerror.h:2357
STDMETHODIMP Drop(IDataObject *pDataObj, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect)
Definition: CSendToZip.cpp:46
STDMETHODIMP GetClassID(CLSID *pclsid)
Definition: CSendToZip.hpp:61
#define BEGIN_COM_MAP(x)
Definition: atlcom.h:541
unsigned long DWORD
Definition: ntddk_ex.h:95
STDMETHODIMP DragOver(DWORD grfKeyState, POINTL pt, DWORD *pdwEffect)
Definition: CSendToZip.cpp:28
#define InterlockedDecrement
Definition: armddk.h:52
#define S_OK
Definition: intsafe.h:51
#define InterlockedIncrement
Definition: armddk.h:53
#define COM_INTERFACE_ENTRY_IID(iid, x)
Definition: atlcom.h:561
#define E_NOTIMPL
Definition: ddrawi.h:99
STDMETHODIMP DragLeave()
Definition: CSendToZip.cpp:38
STDMETHODIMP Load(LPCOLESTR pszFileName, DWORD dwMode)
Definition: CSendToZip.hpp:43
#define DECLARE_PROTECT_FINAL_CONSTRUCT()
Definition: atlcom.h:639
const GUID IID_IPersistFile
EXTERN_C const GUID CLSID_ZipFolderSendTo
Definition: precomp.h:30
STDMETHODIMP Save(LPCOLESTR pszFileName, BOOL fRemember)
Definition: CSendToZip.hpp:47
CComPtr< IDataObject > m_pDataObject
Definition: CSendToZip.hpp:18
#define END_COM_MAP()
Definition: atlcom.h:552
STDMETHODIMP SaveCompleted(LPCOLESTR pszFileName)
Definition: CSendToZip.hpp:51