ReactOS 0.4.15-dev-7906-g1b85a5f
CExeDropHandler Class Reference

#include <CexeDropHandler.h>

Inheritance diagram for CExeDropHandler:
Collaboration diagram for CExeDropHandler:

Public Member Functions

 CExeDropHandler ()
 
 ~CExeDropHandler ()
 
STDMETHOD() DragEnter (IDataObject *pDataObject, DWORD dwKeyState, POINTL pt, DWORD *pdwEffect) override
 
STDMETHOD() DragOver (DWORD dwKeyState, POINTL pt, DWORD *pdwEffect) override
 
STDMETHOD() DragLeave () override
 
STDMETHOD() Drop (IDataObject *pDataObject, DWORD dwKeyState, POINTL pt, DWORD *pdwEffect) override
 
STDMETHOD() GetClassID (CLSID *lpClassId) override
 
STDMETHOD() GetCurFile (LPOLESTR *ppszFileName) override
 
STDMETHOD() IsDirty () override
 
STDMETHOD() Load (LPCOLESTR pszFileName, DWORD dwMode) override
 
STDMETHOD() Save (LPCOLESTR pszFileName, BOOL fRemember) override
 
STDMETHOD() SaveCompleted (LPCOLESTR pszFileName) override
 
- 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

CLSIDpclsid
 
LPWSTR sPathTarget
 

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 24 of file CexeDropHandler.h.

Constructor & Destructor Documentation

◆ CExeDropHandler()

CExeDropHandler::CExeDropHandler ( )

Definition at line 25 of file CexeDropHandler.cpp.

26{
27 pclsid = (CLSID *)&CLSID_ExeDropHandler;
28}

◆ ~CExeDropHandler()

CExeDropHandler::~CExeDropHandler ( )

Definition at line 30 of file CexeDropHandler.cpp.

31{
32
33}

Member Function Documentation

◆ DragEnter()

HRESULT WINAPI CExeDropHandler::DragEnter ( IDataObject pDataObject,
DWORD  dwKeyState,
POINTL  pt,
DWORD pdwEffect 
)
override

Implements IDropTarget.

Definition at line 36 of file CexeDropHandler.cpp.

37{
38 TRACE ("(%p)\n", this);
39 if (*pdwEffect == DROPEFFECT_NONE)
40 return S_OK;
41
42 *pdwEffect = DROPEFFECT_COPY;
43 return S_OK;
44}
const DWORD DROPEFFECT_NONE
Definition: oleidl.idl:929
const DWORD DROPEFFECT_COPY
Definition: oleidl.idl:930
#define S_OK
Definition: intsafe.h:52
#define TRACE(s)
Definition: solgame.cpp:4

◆ DragLeave()

HRESULT WINAPI CExeDropHandler::DragLeave ( void  )
override

Implements IDropTarget.

Definition at line 53 of file CexeDropHandler.cpp.

54{
55 TRACE ("(%p)\n", this);
56 return S_OK;
57}

◆ DragOver()

HRESULT WINAPI CExeDropHandler::DragOver ( DWORD  dwKeyState,
POINTL  pt,
DWORD pdwEffect 
)
override

Implements IDropTarget.

Definition at line 46 of file CexeDropHandler.cpp.

47{
48 TRACE ("(%p)\n", this);
49 *pdwEffect = DROPEFFECT_COPY;
50 return S_OK;
51}

◆ Drop()

HRESULT WINAPI CExeDropHandler::Drop ( IDataObject pDataObject,
DWORD  dwKeyState,
POINTL  pt,
DWORD pdwEffect 
)
override

Implements IDropTarget.

Definition at line 59 of file CexeDropHandler.cpp.

60{
61 TRACE ("(%p)\n", this);
62 FORMATETC fmt;
63 STGMEDIUM medium;
64 LPWSTR pszSrcList;
65 InitFormatEtc (fmt, CF_HDROP, TYMED_HGLOBAL);
66 WCHAR wszBuf[MAX_PATH * 2 + 8], *pszEnd = wszBuf;
67 size_t cchRemaining = _countof(wszBuf);
68
69 if (SUCCEEDED(pDataObject->GetData(&fmt, &medium)) /* && SUCCEEDED(pDataObject->GetData(&fmt2, &medium))*/)
70 {
71 LPDROPFILES lpdf = (LPDROPFILES) GlobalLock(medium.hGlobal);
72 if (!lpdf)
73 {
74 ERR("Error locking global\n");
75 ReleaseStgMedium(&medium);
76 return E_FAIL;
77 }
78 pszSrcList = (LPWSTR) (((byte*) lpdf) + lpdf->pFiles);
79 while (*pszSrcList)
80 {
81 if (StrChrW(pszSrcList, L' ') && cchRemaining > 3)
82 StringCchPrintfExW(pszEnd, cchRemaining, &pszEnd, &cchRemaining, 0, L"\"%ls\" ", pszSrcList);
83 else
84 StringCchPrintfExW(pszEnd, cchRemaining, &pszEnd, &cchRemaining, 0, L"%ls ", pszSrcList);
85
86 pszSrcList += wcslen(pszSrcList) + 1;
87 }
88
89 GlobalUnlock(medium.hGlobal);
90 ReleaseStgMedium(&medium);
91 }
92
94
95 return S_OK;
96}
#define CF_HDROP
Definition: constants.h:410
#define ERR(fmt,...)
Definition: debug.h:110
#define E_FAIL
Definition: ddrawi.h:102
#define NULL
Definition: types.h:112
LPWSTR WINAPI StrChrW(LPCWSTR lpszStr, WCHAR ch)
Definition: string.c:468
#define MAX_PATH
Definition: compat.h:34
void WINAPI ReleaseStgMedium(STGMEDIUM *pmedium)
Definition: ole2.c:2033
#define InitFormatEtc(fe, cf, med)
Definition: editor.h:32
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
Definition: heapmem.c:755
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
HRESULT GetData([in, unique] FORMATETC *pformatetcIn, [out] STGMEDIUM *pmedium)
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define L(x)
Definition: ntvdm.h:50
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2402
struct _DROPFILES * LPDROPFILES
#define _countof(array)
Definition: sndvol32.h:68
STRSAFEAPI StringCchPrintfExW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPWSTR *ppszDestEnd, size_t *pcchRemaining, STRSAFE_DWORD dwFlags, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:585
Definition: dsound.c:943
#define SW_SHOWNORMAL
Definition: winuser.h:770
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184

◆ GetClassID()

HRESULT WINAPI CExeDropHandler::GetClassID ( CLSID lpClassId)
override

Implements IPersist.

Definition at line 135 of file CexeDropHandler.cpp.

136{
137 TRACE ("(%p)\n", this);
138
139 if (!lpClassId)
140 return E_POINTER;
141
142 *lpClassId = *pclsid;
143
144 return S_OK;
145}
#define E_POINTER
Definition: winerror.h:2365

◆ GetCurFile()

HRESULT WINAPI CExeDropHandler::GetCurFile ( LPOLESTR ppszFileName)
override

Implements IPersistFile.

Definition at line 100 of file CexeDropHandler.cpp.

101{
102 FIXME ("(%p)\n", this);
103 return E_NOTIMPL;
104}
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ IsDirty()

HRESULT WINAPI CExeDropHandler::IsDirty ( void  )
override

Implements IPersistFile.

Definition at line 106 of file CexeDropHandler.cpp.

107{
108 FIXME ("(%p)\n", this);
109 return E_NOTIMPL;
110}

◆ Load()

HRESULT WINAPI CExeDropHandler::Load ( LPCOLESTR  pszFileName,
DWORD  dwMode 
)
override

Implements IPersistFile.

Definition at line 112 of file CexeDropHandler.cpp.

113{
115 sPathTarget = (WCHAR *)SHAlloc((len + 1) * sizeof(WCHAR));
116 memcpy(sPathTarget, pszFileName, (len + 1) * sizeof(WCHAR));
117 return S_OK;
118}
LPVOID WINAPI SHAlloc(SIZE_T len)
Definition: shellole.c:304
GLenum GLsizei len
Definition: glext.h:6722
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
unsigned int UINT
Definition: ndis.h:50
#define strlenW(s)
Definition: unicode.h:28
WORD WORD PSZ PSZ pszFileName
Definition: vdmdbg.h:44

◆ Save()

HRESULT WINAPI CExeDropHandler::Save ( LPCOLESTR  pszFileName,
BOOL  fRemember 
)
override

Implements IPersistFile.

Definition at line 120 of file CexeDropHandler.cpp.

121{
122 FIXME ("(%p)\n", this);
123 return E_NOTIMPL;
124}

◆ SaveCompleted()

HRESULT WINAPI CExeDropHandler::SaveCompleted ( LPCOLESTR  pszFileName)
override

Implements IPersistFile.

Definition at line 126 of file CexeDropHandler.cpp.

127{
128 FIXME ("(%p)\n", this);
129 return E_NOTIMPL;
130}

Member Data Documentation

◆ pclsid

CLSID* CExeDropHandler::pclsid
private

Definition at line 31 of file CexeDropHandler.h.

Referenced by CExeDropHandler(), and GetClassID().

◆ sPathTarget

LPWSTR CExeDropHandler::sPathTarget
private

Definition at line 32 of file CexeDropHandler.h.

Referenced by Drop(), and Load().


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