ReactOS  0.4.12-dev-75-g00dd17e
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:3449
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
LONG y
Definition: windef.h:320
smooth NULL
Definition: ftsmooth.c:416
#define TreeView_SelectDropTarget(hwnd, hitem)
Definition: commctrl.h:3449
#define TreeView_HitTest(hwnd, lpht)
Definition: commctrl.h:3480
LONG x
Definition: windef.h:319
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:3494

◆ 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
GLenum GLclampf GLint i
Definition: glfuncs.h:14
smooth NULL
Definition: ftsmooth.c:416
#define CF_HDROP
Definition: constants.h:410
#define TreeView_SelectDropTarget(hwnd, hitem)
Definition: commctrl.h:3449
char TCHAR
Definition: xmlstorage.h:189
#define MAX_PATH
Definition: compat.h:26
unsigned int UINT
Definition: ndis.h:50
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
Definition: heapmem.c:755
const DWORD DROPEFFECT_MOVE
Definition: oleidl.idl:931
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
#define DragQueryFile
Definition: shellapi.h:672

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