OLE drop target for the desktop window. More...
#include <desktop.h>
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) |
OLE drop target for the desktop window.
Definition at line 95 of file desktop.h.
DesktopDropTarget::DesktopDropTarget | ( | HWND | hTargetWnd ) | [inline] |
virtual HRESULT STDMETHODCALLTYPE DesktopDropTarget::DragLeave | ( | void | ) | [inline, virtual] |
Reimplemented from IDropTargetImpl.
Definition at line 158 of file desktop.h.
References IDropTargetImpl::DragLeave().
{ //@@ TreeView_SelectDropTarget(m_hTargetWnd, NULL); return super::DragLeave(); }
virtual HRESULT STDMETHODCALLTYPE DesktopDropTarget::DragOver | ( | DWORD | grfKeyState, |
POINTL | pt, | ||
DWORD __RPC_FAR * | pdwEffect | ||
) | [inline, virtual] |
Reimplemented from IDropTargetImpl.
Definition at line 138 of file desktop.h.
References IDropTargetImpl::DragOver(), IDropTargetImpl::m_hTargetWnd, and ScreenToClient().
{ TVHITTESTINFO hit; hit.pt = (POINT&)pt; ScreenToClient(m_hTargetWnd, &hit.pt); hit.flags = TVHT_ONITEM; /*@@ HTREEITEM hItem = TreeView_HitTest(m_hTargetWnd,&hit); if (hItem != NULL) TreeView_SelectDropTarget(m_hTargetWnd, hItem); */ return super::DragOver(grfKeyState, pt, pdwEffect); }
virtual bool DesktopDropTarget::OnDrop | ( | FORMATETC * | pFmtEtc, |
STGMEDIUM & | medium, | ||
DWORD * | pdwEffect | ||
) | [inline, virtual] |
Implements IDropTargetImpl.
Definition at line 102 of file desktop.h.
{ if (pFmtEtc->cfFormat==CF_HDROP && medium.tymed==TYMED_HGLOBAL) { HDROP hDrop = (HDROP)GlobalLock(medium.hGlobal); if (hDrop) { TCHAR szFileName[MAX_PATH]; UINT cFiles = DragQueryFile(hDrop, 0xFFFFFFFF, NULL, 0); for(UINT i=0; i<cFiles; ++i) { DragQueryFile(hDrop, i, szFileName, sizeof(szFileName)); if (DROPEFFECT_COPY & *pdwEffect) { // copy the file or dir ///@todo Add the code to handle Copy } else if (DROPEFFECT_MOVE & *pdwEffect) { // move the file or dir ///@todo Add the code to handle Move } } //DragFinish(hDrop); // base class calls ReleaseStgMedium } GlobalUnlock(medium.hGlobal); } //@@TreeView_SelectDropTarget(m_hTargetWnd, NULL); return true; //let base free the medium }
ROS Explorer Source Code Documentation
generated on 02.01.2013 by ![]() |