ReactOS 0.4.15-dev-7918-g2a2556c
DesktopDropTarget Class Reference

OLE drop target for the desktop window. More...

#include <desktop.h>

Inheritance diagram for DesktopDropTarget:
Collaboration diagram for DesktopDropTarget:

Public Member Functions

 DesktopDropTarget (HWND hTargetWnd)
 
virtual bool OnDrop (FORMATETC *pFmtEtc, STGMEDIUM &medium, DWORD *pdwEffect)
 
virtual HRESULT STDMETHODCALLTYPE DragOver (DWORD grfKeyState, POINTL pt, DWORD __RPC_FAR *pdwEffect)
 
virtual HRESULT STDMETHODCALLTYPE DragLeave (void)
 
- Public Member Functions inherited from IDropTargetImpl
 IDropTargetImpl (HWND m_hTargetWnd)
 
virtual ~IDropTargetImpl ()
 
void AddSuportedFormat (FORMATETC &ftetc)
 
virtual bool OnDrop (FORMATETC *pFmtEtc, STGMEDIUM &medium, DWORD *pdwEffect)=0
 
virtual HRESULT STDMETHODCALLTYPE QueryInterface (REFIID riid, void __RPC_FAR *__RPC_FAR *ppvObject)
 
virtual ULONG STDMETHODCALLTYPE AddRef ()
 
virtual ULONG STDMETHODCALLTYPE Release ()
 
bool QueryDrop (DWORD grfKeyState, LPDWORD pdwEffect)
 
virtual HRESULT STDMETHODCALLTYPE DragEnter (IDataObject __RPC_FAR *pDataObj, DWORD grfKeyState, POINTL pt, DWORD __RPC_FAR *pdwEffect)
 
virtual HRESULT STDMETHODCALLTYPE DragOver (DWORD grfKeyState, POINTL pt, DWORD __RPC_FAR *pdwEffect)
 
virtual HRESULT STDMETHODCALLTYPE DragLeave ()
 
virtual HRESULT STDMETHODCALLTYPE Drop (IDataObject __RPC_FAR *pDataObj, DWORD grfKeyState, POINTL pt, DWORD __RPC_FAR *pdwEffect)
 
- Public Member Functions inherited from IDropTarget
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 ()
 

Private Types

typedef IDropTargetImpl super
 

Additional Inherited Members

- Public Types inherited from IDropTarget
typedef IDropTargetLPDROPTARGET
 
- Public Types inherited from IUnknown
typedef IUnknownLPUNKNOWN
 
- 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
 
- Protected Attributes inherited from IDropTargetImpl
HWND m_hTargetWnd
 

Detailed Description

OLE drop target for the desktop window.

Definition at line 95 of file desktop.h.

Member Typedef Documentation

◆ super

Definition at line 97 of file desktop.h.

Constructor & Destructor Documentation

◆ DesktopDropTarget()

DesktopDropTarget::DesktopDropTarget ( HWND  hTargetWnd)
inline

Definition at line 100 of file desktop.h.

100: super(hTargetWnd) {}
IDropTargetImpl super
Definition: desktop.h:97

Member Function Documentation

◆ DragLeave()

virtual HRESULT STDMETHODCALLTYPE DesktopDropTarget::DragLeave ( void  )
inlinevirtual

Reimplemented from IDropTargetImpl.

Definition at line 159 of file desktop.h.

160 {
161 //@@ TreeView_SelectDropTarget(m_hTargetWnd, NULL);
162
163 return super::DragLeave();
164 }
virtual HRESULT STDMETHODCALLTYPE DragLeave()

◆ DragOver()

virtual HRESULT STDMETHODCALLTYPE DesktopDropTarget::DragOver ( DWORD  grfKeyState,
POINTL  pt,
DWORD __RPC_FAR pdwEffect 
)
inlinevirtual

Reimplemented from IDropTargetImpl.

Definition at line 138 of file desktop.h.

142 {
143 TVHITTESTINFO hit;
144 hit.pt.x = pt.x;
145 hit.pt.y = pt.y;
147 hit.flags = TVHT_ONITEM;
148
149 /*@@
150 HTREEITEM hItem = TreeView_HitTest(m_hTargetWnd,&hit);
151
152 if (hItem != NULL)
153 TreeView_SelectDropTarget(m_hTargetWnd, hItem);
154 */
155
156 return super::DragOver(grfKeyState, pt, pdwEffect);
157 }
virtual HRESULT STDMETHODCALLTYPE DragOver(DWORD grfKeyState, POINTL pt, DWORD __RPC_FAR *pdwEffect)
#define pt(x, y)
Definition: drawing.c:79
#define TVHT_ONITEM
Definition: commctrl.h:3527
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
BOOL WINAPI ScreenToClient(_In_ HWND, _Inout_ LPPOINT)

◆ OnDrop()

virtual bool DesktopDropTarget::OnDrop ( FORMATETC *  pFmtEtc,
STGMEDIUM &  medium,
DWORD pdwEffect 
)
inlinevirtual
Todo:
Add the code to handle Copy
Todo:
Add the code to handle Move

Implements IDropTargetImpl.

Definition at line 102 of file desktop.h.

103 {
104 if (pFmtEtc->cfFormat==CF_HDROP && medium.tymed==TYMED_HGLOBAL) {
105 HDROP hDrop = (HDROP)GlobalLock(medium.hGlobal);
106
107 if (hDrop) {
108 TCHAR szFileName[MAX_PATH];
109
110 UINT cFiles = DragQueryFile(hDrop, 0xFFFFFFFF, NULL, 0);
111
112 for(UINT i=0; i<cFiles; ++i) {
113 DragQueryFile(hDrop, i, szFileName, sizeof(szFileName) / sizeof(szFileName[0]));
114
115 if (DROPEFFECT_COPY & *pdwEffect) {
116 // copy the file or dir
117
119
120 } else if (DROPEFFECT_MOVE & *pdwEffect) {
121 // move the file or dir
122
124
125 }
126 }
127 //DragFinish(hDrop); // base class calls ReleaseStgMedium
128 }
129
130 GlobalUnlock(medium.hGlobal);
131 }
132
133 //@@TreeView_SelectDropTarget(m_hTargetWnd, NULL);
134
135 return true; //let base free the medium
136 }
#define CF_HDROP
Definition: constants.h:410
#define NULL
Definition: types.h:112
#define MAX_PATH
Definition: compat.h:34
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
Definition: heapmem.c:755
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
const DWORD DROPEFFECT_COPY
Definition: oleidl.idl:930
const DWORD DROPEFFECT_MOVE
Definition: oleidl.idl:931
unsigned int UINT
Definition: ndis.h:50
#define DragQueryFile
Definition: shellapi.h:686
char TCHAR
Definition: xmlstorage.h:189

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