ReactOS  0.4.15-dev-489-g75a0787
CExeDropHandler Class Reference

#include <CexeDropHandler.h>

Inheritance diagram for CExeDropHandler:
Collaboration diagram for CExeDropHandler:

Public Member Functions

 CExeDropHandler ()
 
 ~CExeDropHandler ()
 
virtual HRESULT WINAPI DragEnter (IDataObject *pDataObject, DWORD dwKeyState, POINTL pt, DWORD *pdwEffect)
 
virtual HRESULT WINAPI DragOver (DWORD dwKeyState, POINTL pt, DWORD *pdwEffect)
 
virtual HRESULT WINAPI DragLeave ()
 
virtual HRESULT WINAPI Drop (IDataObject *pDataObject, DWORD dwKeyState, POINTL pt, DWORD *pdwEffect)
 
virtual HRESULT WINAPI GetClassID (CLSID *lpClassId)
 
virtual HRESULT WINAPI GetCurFile (LPOLESTR *ppszFileName)
 
virtual HRESULT WINAPI IsDirty ()
 
virtual HRESULT WINAPI Load (LPCOLESTR pszFileName, DWORD dwMode)
 
virtual HRESULT WINAPI Save (LPCOLESTR pszFileName, BOOL fRemember)
 
virtual HRESULT WINAPI SaveCompleted (LPCOLESTR pszFileName)
 
- 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 ()
 
- Public Member Functions inherited from IUnknown
HRESULT QueryInterface ([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
 
ULONG AddRef ()
 
ULONG Release ()
 

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 
)
virtual

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_COPY
Definition: oleidl.idl:930
const DWORD DROPEFFECT_NONE
Definition: oleidl.idl:929
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59

◆ DragLeave()

HRESULT WINAPI CExeDropHandler::DragLeave ( void  )
virtual

Implements IDropTarget.

Definition at line 53 of file CexeDropHandler.cpp.

54 {
55  TRACE ("(%p)\n", this);
56  return S_OK;
57 }
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59

◆ DragOver()

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

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 }
const DWORD DROPEFFECT_COPY
Definition: oleidl.idl:930
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59

◆ Drop()

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

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  return E_FAIL;
76  }
77  pszSrcList = (LPWSTR) (((byte*) lpdf) + lpdf->pFiles);
78  while (*pszSrcList)
79  {
80  if (StrChrW(pszSrcList, L' ') && cchRemaining > 3)
81  StringCchPrintfExW(pszEnd, cchRemaining, &pszEnd, &cchRemaining, 0, L"\"%ls\" ", pszSrcList);
82  else
83  StringCchPrintfExW(pszEnd, cchRemaining, &pszEnd, &cchRemaining, 0, L"%ls ", pszSrcList);
84 
85  pszSrcList += wcslen(pszSrcList) + 1;
86  }
87  }
88 
90 
91  return S_OK;
92 }
struct _DROPFILES * LPDROPFILES
#define InitFormatEtc(fe, cf, med)
Definition: editor.h:32
const char * fmt
Definition: wsprintf.c:30
HRESULT GetData([in, unique] FORMATETC *pformatetcIn, [out] STGMEDIUM *pmedium)
#define E_FAIL
Definition: ddrawi.h:102
STRSAFEAPI StringCchPrintfExW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPWSTR *ppszDestEnd, size_t *pcchRemaining, STRSAFE_DWORD dwFlags, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:585
smooth NULL
Definition: ftsmooth.c:416
#define CF_HDROP
Definition: constants.h:410
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define _countof(array)
Definition: sndvol32.h:68
#define MAX_PATH
Definition: compat.h:26
static const WCHAR L[]
Definition: oid.c:1250
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
Definition: heapmem.c:755
#define ERR(fmt,...)
Definition: debug.h:110
#define S_OK
Definition: intsafe.h:59
#define SW_SHOWNORMAL
Definition: winuser.h:764
LPWSTR WINAPI StrChrW(LPCWSTR lpszStr, WCHAR ch)
Definition: string.c:468
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2274
WCHAR * LPWSTR
Definition: xmlstorage.h:184
Definition: dsound.c:943
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ GetClassID()

HRESULT WINAPI CExeDropHandler::GetClassID ( CLSID lpClassId)
virtual

Implements IPersist.

Definition at line 131 of file CexeDropHandler.cpp.

132 {
133  TRACE ("(%p)\n", this);
134 
135  if (!lpClassId)
136  return E_POINTER;
137 
138  *lpClassId = *pclsid;
139 
140  return S_OK;
141 }
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59
#define E_POINTER
Definition: winerror.h:2365

◆ GetCurFile()

HRESULT WINAPI CExeDropHandler::GetCurFile ( LPOLESTR ppszFileName)
virtual

Implements IPersistFile.

Definition at line 96 of file CexeDropHandler.cpp.

97 {
98  FIXME ("(%p)\n", this);
99  return E_NOTIMPL;
100 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ IsDirty()

HRESULT WINAPI CExeDropHandler::IsDirty ( void  )
virtual

Implements IPersistFile.

Definition at line 102 of file CexeDropHandler.cpp.

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

◆ Load()

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

Implements IPersistFile.

Definition at line 108 of file CexeDropHandler.cpp.

109 {
111  sPathTarget = (WCHAR *)SHAlloc((len + 1) * sizeof(WCHAR));
112  memcpy(sPathTarget, pszFileName, (len + 1) * sizeof(WCHAR));
113  return S_OK;
114 }
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
WORD WORD PSZ PSZ pszFileName
Definition: vdmdbg.h:41
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
#define S_OK
Definition: intsafe.h:59
unsigned int UINT
Definition: ndis.h:50
LPVOID WINAPI SHAlloc(SIZE_T len)
Definition: shellole.c:309

◆ Save()

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

Implements IPersistFile.

Definition at line 116 of file CexeDropHandler.cpp.

117 {
118  FIXME ("(%p)\n", this);
119  return E_NOTIMPL;
120 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ SaveCompleted()

HRESULT WINAPI CExeDropHandler::SaveCompleted ( LPCOLESTR  pszFileName)
virtual

Implements IPersistFile.

Definition at line 122 of file CexeDropHandler.cpp.

123 {
124  FIXME ("(%p)\n", this);
125  return E_NOTIMPL;
126 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

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: