ReactOS  0.4.14-dev-556-g4c5b21f
TreeDropTarget Class Reference

OLE drop target for tree controls. More...

#include <treedroptarget.h>

Inheritance diagram for TreeDropTarget:
Collaboration diagram for TreeDropTarget:

Public Member Functions

 TreeDropTarget (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 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 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 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)
 

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 tree controls.

Definition at line 13 of file treedroptarget.h.

Constructor & Destructor Documentation

◆ TreeDropTarget()

TreeDropTarget::TreeDropTarget ( HWND  hTargetWnd)
inline

Definition at line 16 of file treedroptarget.h.

16 : IDropTargetImpl(hTargetWnd) {}
IDropTargetImpl(HWND m_hTargetWnd)

Member Function Documentation

◆ DragLeave()

virtual HRESULT STDMETHODCALLTYPE TreeDropTarget::DragLeave ( void  )
inlinevirtual

Reimplemented from IDropTargetImpl.

Definition at line 76 of file treedroptarget.h.

77  {
79 
81  }
smooth NULL
Definition: ftsmooth.c:416
#define TreeView_SelectDropTarget(hwnd, hitem)
Definition: commctrl.h:3478
virtual HRESULT STDMETHODCALLTYPE DragLeave()

◆ DragOver()

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

Reimplemented from IDropTargetImpl.

Definition at line 58 of file treedroptarget.h.

62  {
63  TVHITTESTINFO hit;
64  hit.pt.x = pt.x;
65  hit.pt.y = pt.y;
67  hit.flags = TVHT_ONITEM;
69 
70  if (hItem != NULL)
72 
73  return IDropTargetImpl::DragOver(grfKeyState, pt, pdwEffect);
74  }
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
#define pt(x, y)
Definition: drawing.c:79
smooth NULL
Definition: ftsmooth.c:416
#define TreeView_SelectDropTarget(hwnd, hitem)
Definition: commctrl.h:3478
#define TreeView_HitTest(hwnd, lpht)
Definition: commctrl.h:3509
virtual HRESULT STDMETHODCALLTYPE DragOver(DWORD grfKeyState, POINTL pt, DWORD __RPC_FAR *pdwEffect)
BOOL WINAPI ScreenToClient(_In_ HWND, _Inout_ LPPOINT)
#define TVHT_ONITEM
Definition: commctrl.h:3523

◆ OnDrop()

virtual bool TreeDropTarget::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 18 of file treedroptarget.h.

19  {
20  if (pFmtEtc->cfFormat == CF_HDROP && medium.tymed == TYMED_HGLOBAL)
21  {
22  HDROP hDrop = (HDROP)GlobalLock(medium.hGlobal);
23  if (hDrop != NULL)
24  {
25  TCHAR szFileName[MAX_PATH];
26 
27  UINT cFiles = DragQueryFile(hDrop, 0xFFFFFFFF, NULL, 0);
28 
29  for(UINT i = 0; i < cFiles; ++i)
30  {
31  DragQueryFile(hDrop, i, szFileName, sizeof(szFileName));
32 
33  if (DROPEFFECT_COPY & *pdwEffect)
34  {
35  // copy the file or dir
36 
38 
39  }
40  else if (DROPEFFECT_MOVE & *pdwEffect)
41  {
42  // move the file or dir
43 
45 
46  }
47  }
48  //DragFinish(hDrop); // base class calls ReleaseStgMedium
49  }
50  GlobalUnlock(medium.hGlobal);
51  }
52 
54 
55  return true; //let base free the medium
56  }
const DWORD DROPEFFECT_COPY
Definition: oleidl.idl:930
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
smooth NULL
Definition: ftsmooth.c:416
#define CF_HDROP
Definition: constants.h:410
#define TreeView_SelectDropTarget(hwnd, hitem)
Definition: commctrl.h:3478
char TCHAR
Definition: xmlstorage.h:189
#define MAX_PATH
Definition: compat.h:26
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
Definition: heapmem.c:755
const DWORD DROPEFFECT_MOVE
Definition: oleidl.idl:931
unsigned int UINT
Definition: ndis.h:50
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
#define DragQueryFile
Definition: shellapi.h:682

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