ReactOS 0.4.15-dev-8131-g4988de4
CSendToZip Class Reference

#include <CSendToZip.hpp>

Inheritance diagram for CSendToZip:
Collaboration diagram for CSendToZip:

Public Member Functions

 CSendToZip ()
 
virtual ~CSendToZip ()
 
STDMETHODIMP DragEnter (IDataObject *pDataObj, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect)
 
STDMETHODIMP DragOver (DWORD grfKeyState, POINTL pt, DWORD *pdwEffect)
 
STDMETHODIMP DragLeave ()
 
STDMETHODIMP Drop (IDataObject *pDataObj, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect)
 
STDMETHODIMP IsDirty ()
 
STDMETHODIMP Load (LPCOLESTR pszFileName, DWORD dwMode)
 
STDMETHODIMP Save (LPCOLESTR pszFileName, BOOL fRemember)
 
STDMETHODIMP SaveCompleted (LPCOLESTR pszFileName)
 
STDMETHODIMP GetCurFile (LPOLESTR *ppszFileName)
 
STDMETHODIMP GetClassID (CLSID *pclsid)
 
- Public Member Functions inherited from ATL::CComObjectRootEx< CComMultiThreadModelNoCS >
 ~CComObjectRootEx ()
 
ULONG InternalAddRef ()
 
ULONG InternalRelease ()
 
void Lock ()
 
void Unlock ()
 
HRESULT _AtlInitialConstruct ()
 
- Public Member Functions inherited from ATL::CComObjectRootBase
 CComObjectRootBase ()
 
 ~CComObjectRootBase ()
 
void SetVoid (void *)
 
HRESULT _AtlFinalConstruct ()
 
HRESULT FinalConstruct ()
 
void InternalFinalConstructAddRef ()
 
void InternalFinalConstructRelease ()
 
void FinalRelease ()
 
HRESULT DragEnter ([in, unique] IDataObject *pDataObj, [in] DWORD grfKeyState, [in] POINTL pt, [in, out] DWORD *pdwEffect)
 
HRESULT DragOver ([in] DWORD grfKeyState, [in] POINTL pt, [in, out] DWORD *pdwEffect)
 
HRESULT DragLeave ()
 
HRESULT Drop ([in, unique] IDataObject *pDataObj, [in] DWORD grfKeyState, [in] POINTL pt, [in, out] DWORD *pdwEffect)
 
- Public Member Functions inherited from IUnknown
HRESULT QueryInterface ([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
 
ULONG AddRef ()
 
ULONG Release ()
 
HRESULT IsDirty ()
 
HRESULT Load ([in] LPCOLESTR pszFileName, [in] DWORD dwMode)
 
HRESULT Save ([in, unique] LPCOLESTR pszFileName, [in] BOOL fRemember)
 
HRESULT SaveCompleted ([in, unique] LPCOLESTR pszFileName)
 
HRESULT GetCurFile ([out] LPOLESTR *ppszFileName)
 
HRESULT GetClassID ([out] CLSID *pClassID)
 

Private Attributes

CComPtr< IDataObjectm_pDataObject
 
BOOL m_fCanDragDrop
 

Additional Inherited Members

- Public Types inherited from IDropTarget
typedef IDropTargetLPDROPTARGET
 
- Public Types inherited from IUnknown
typedef IUnknownLPUNKNOWN
 
- Public Types inherited from IPersistFile
typedef IPersistFileLPPERSISTFILE
 
- Public Types inherited from IPersist
typedef IPersistLPPERSIST
 
- Static Public Member Functions inherited from ATL::CComObjectRootBase
static void WINAPI ObjectMain (bool)
 
static const struct _ATL_CATMAP_ENTRYGetCategoryMap ()
 
static HRESULT WINAPI InternalQueryInterface (void *pThis, const _ATL_INTMAP_ENTRY *pEntries, REFIID iid, void **ppvObject)
 
- Public Attributes inherited from ATL::CComObjectRootBase
LONG m_dwRef
 
- Public Attributes inherited from IDropTarget
const DWORD MK_ALT = 0x20
 
const DWORD DROPEFFECT_NONE = 0
 
const DWORD DROPEFFECT_COPY = 1
 
const DWORD DROPEFFECT_MOVE = 2
 
const DWORD DROPEFFECT_LINK = 4
 
const DWORD DROPEFFECT_SCROLL = 0x80000000
 
const DWORD DD_DEFSCROLLINSET = 11
 
const DWORD DD_DEFSCROLLDELAY = 50
 
const DWORD DD_DEFSCROLLINTERVAL = 50
 
const DWORD DD_DEFDRAGDELAY = 200
 
const DWORD DD_DEFDRAGMINDIST = 2
 

Detailed Description

Definition at line 12 of file CSendToZip.hpp.

Constructor & Destructor Documentation

◆ CSendToZip()

CSendToZip::CSendToZip ( )
inline

Definition at line 22 of file CSendToZip.hpp.

23 {
25 }
LONG g_ModuleRefCnt
Definition: ACPPage.cpp:13
#define InterlockedIncrement
Definition: armddk.h:53
BOOL m_fCanDragDrop
Definition: CSendToZip.hpp:19
#define FALSE
Definition: types.h:117

◆ ~CSendToZip()

virtual CSendToZip::~CSendToZip ( )
inlinevirtual

Definition at line 27 of file CSendToZip.hpp.

28 {
30 }
#define InterlockedDecrement
Definition: armddk.h:52

Member Function Documentation

◆ DragEnter()

STDMETHODIMP CSendToZip::DragEnter ( IDataObject pDataObj,
DWORD  grfKeyState,
POINTL  pt,
DWORD pdwEffect 
)

Implements IDropTarget.

Definition at line 12 of file CSendToZip.cpp.

14{
15 m_pDataObject = pDataObj;
16
17 FORMATETC etc = { CF_HDROP, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
18 m_fCanDragDrop = SUCCEEDED(pDataObj->QueryGetData(&etc));
19
21 *pdwEffect &= DROPEFFECT_COPY;
22 else
23 *pdwEffect = DROPEFFECT_NONE;
24
25 return S_OK;
26}
#define CF_HDROP
Definition: constants.h:410
CComPtr< IDataObject > m_pDataObject
Definition: CSendToZip.hpp:18
#define NULL
Definition: types.h:112
HRESULT QueryGetData([in, unique] FORMATETC *pformatetc)
const DWORD DROPEFFECT_NONE
Definition: oleidl.idl:929
const DWORD DROPEFFECT_COPY
Definition: oleidl.idl:930
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50

◆ DragLeave()

STDMETHODIMP CSendToZip::DragLeave ( void  )

Implements IDropTarget.

Definition at line 38 of file CSendToZip.cpp.

39{
42 return S_OK;
43}
void Release()
Definition: atlcomcli.h:170

Referenced by Drop().

◆ DragOver()

STDMETHODIMP CSendToZip::DragOver ( DWORD  grfKeyState,
POINTL  pt,
DWORD pdwEffect 
)

Implements IDropTarget.

Definition at line 28 of file CSendToZip.cpp.

29{
31 *pdwEffect &= DROPEFFECT_COPY;
32 else
33 *pdwEffect = DROPEFFECT_NONE;
34
35 return S_OK;
36}

◆ Drop()

STDMETHODIMP CSendToZip::Drop ( IDataObject pDataObj,
DWORD  grfKeyState,
POINTL  pt,
DWORD pdwEffect 
)

Implements IDropTarget.

Definition at line 46 of file CSendToZip.cpp.

48{
49 m_pDataObject = pDataObj;
50
51 if (!pDataObj || !m_fCanDragDrop)
52 {
53 DPRINT1("Drop failed: %d %d\n", !pDataObj, !m_fCanDragDrop);
54 *pdwEffect = 0;
55 DragLeave();
56 return E_FAIL;
57 }
58
59 STGMEDIUM stg;
60 FORMATETC etc = { CF_HDROP, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
61 HRESULT hr = pDataObj->GetData(&etc, &stg);
63 {
64 *pdwEffect = 0;
65 DragLeave();
66 return E_FAIL;
67 }
68
69 HDROP hDrop = reinterpret_cast<HDROP>(stg.hGlobal);
70 UINT cItems = ::DragQueryFileW(hDrop, -1, NULL, 0);
71
73
74 for (UINT iItem = 0; iItem < cItems; ++iItem)
75 {
77 DragQueryFileW(hDrop, iItem, szPath, _countof(szPath));
78
79 pCreator->DoAddItem(szPath);
80 }
81
83
84 CZipCreator::runThread(pCreator); // pCreator is deleted in runThread
85
86 DragLeave();
87 return hr;
88}
#define DPRINT1
Definition: precomp.h:8
STDMETHODIMP DragLeave()
Definition: CSendToZip.cpp:38
static CZipCreator * DoCreate()
Definition: CZipCreator.hpp:20
static BOOL runThread(CZipCreator *pCreator)
virtual void DoAddItem(PCWSTR pszFile)
#define E_FAIL
Definition: ddrawi.h:102
#define MAX_PATH
Definition: compat.h:34
#define FAILED_UNEXPECTEDLY(hr)
Definition: precomp.h:121
void WINAPI ReleaseStgMedium(STGMEDIUM *pmedium)
Definition: ole2.c:2033
UINT WINAPI DragQueryFileW(HDROP hDrop, UINT lFile, LPWSTR lpszwFile, UINT lLength)
Definition: shellole.c:622
HRESULT GetData([in, unique] FORMATETC *pformatetcIn, [out] STGMEDIUM *pmedium)
LPCWSTR szPath
Definition: env.c:37
unsigned int UINT
Definition: ndis.h:50
HRESULT hr
Definition: shlfolder.c:183
#define _countof(array)
Definition: sndvol32.h:70
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ GetClassID()

STDMETHODIMP CSendToZip::GetClassID ( CLSID pclsid)
inline

Implements IPersist.

Definition at line 61 of file CSendToZip.hpp.

62 {
63 *pclsid = CLSID_ZipFolderSendTo;
64 return S_OK;
65 }
EXTERN_C const GUID CLSID_ZipFolderSendTo
Definition: precomp.h:29

◆ GetCurFile()

STDMETHODIMP CSendToZip::GetCurFile ( LPOLESTR ppszFileName)
inline

Implements IPersistFile.

Definition at line 55 of file CSendToZip.hpp.

56 {
57 return E_NOTIMPL;
58 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ IsDirty()

STDMETHODIMP CSendToZip::IsDirty ( void  )
inline

Implements IPersistFile.

Definition at line 39 of file CSendToZip.hpp.

40 {
41 return S_FALSE;
42 }
#define S_FALSE
Definition: winerror.h:2357

◆ Load()

STDMETHODIMP CSendToZip::Load ( LPCOLESTR  pszFileName,
DWORD  dwMode 
)
inline

Implements IPersistFile.

Definition at line 43 of file CSendToZip.hpp.

44 {
45 return S_OK;
46 }

◆ Save()

STDMETHODIMP CSendToZip::Save ( LPCOLESTR  pszFileName,
BOOL  fRemember 
)
inline

Implements IPersistFile.

Definition at line 47 of file CSendToZip.hpp.

48 {
49 return E_NOTIMPL;
50 }

◆ SaveCompleted()

STDMETHODIMP CSendToZip::SaveCompleted ( LPCOLESTR  pszFileName)
inline

Implements IPersistFile.

Definition at line 51 of file CSendToZip.hpp.

52 {
53 return E_NOTIMPL;
54 }

Member Data Documentation

◆ m_fCanDragDrop

BOOL CSendToZip::m_fCanDragDrop
private

Definition at line 19 of file CSendToZip.hpp.

Referenced by DragEnter(), DragLeave(), DragOver(), and Drop().

◆ m_pDataObject

CComPtr<IDataObject> CSendToZip::m_pDataObject
private

Definition at line 18 of file CSendToZip.hpp.

Referenced by DragEnter(), DragLeave(), and Drop().


The documentation for this class was generated from the following files: