#pragma
once
#include < afxole.h >
class CDropTarget
{
public:
CDropTarget() {}
virtual DROPEFFECT OnDragEnter(COleDataObject* pDataObject, DWORD dwKeyState, CPoint point) {return DROPEFFECT_NONE;}
virtual DROPEFFECT OnDragOver(COleDataObject* pDataObject, DWORD dwKeyState, CPoint point) {return DROPEFFECT_NONE;}
virtual BOOL OnDrop(COleDataObject* pDataObject, DROPEFFECT dropEffect, CPoint point) {return FALSE;}
virtual DROPEFFECT OnDropEx(COleDataObject* pDataObject, DROPEFFECT dropDefault, DROPEFFECT dropList, CPoint point) {return (DROPEFFECT)-1;}
virtual void OnDragLeave() {}
virtual DROPEFFECT OnDragScroll(DWORD dwKeyState, CPoint point) {return DROPEFFECT_NONE;}
} ;
// CFileDropTarget command target
class CFileDropTarget : public COleDropTarget
{
// DECLARE_DYNAMIC(CFileDropTarget)
private:
CDropTarget* m_pDropTarget;
public:
CFileDropTarget(CDropTarget* pDropTarget);
virtual ~CFileDropTarget();
protected:
DECLARE_MESSAGE_MAP()
DROPEFFECT OnDragEnter(CWnd* pWnd, COleDataObject* pDataObject, DWORD dwKeyState, CPoint point);
DROPEFFECT OnDragOver(CWnd* pWnd, COleDataObject* pDataObject, DWORD dwKeyState, CPoint point);
BOOL OnDrop(CWnd* pWnd, COleDataObject* pDataObject, DROPEFFECT dropEffect, CPoint point);
DROPEFFECT OnDropEx(CWnd* pWnd, COleDataObject* pDataObject, DROPEFFECT dropDefault, DROPEFFECT dropList, CPoint point);
void OnDragLeave(CWnd* pWnd);
DROPEFFECT OnDragScroll(CWnd* pWnd, DWORD dwKeyState, CPoint point);
} ;
#include < afxole.h >
class CDropTarget
{
public:
CDropTarget() {}
virtual DROPEFFECT OnDragEnter(COleDataObject* pDataObject, DWORD dwKeyState, CPoint point) {return DROPEFFECT_NONE;}
virtual DROPEFFECT OnDragOver(COleDataObject* pDataObject, DWORD dwKeyState, CPoint point) {return DROPEFFECT_NONE;}
virtual BOOL OnDrop(COleDataObject* pDataObject, DROPEFFECT dropEffect, CPoint point) {return FALSE;}
virtual DROPEFFECT OnDropEx(COleDataObject* pDataObject, DROPEFFECT dropDefault, DROPEFFECT dropList, CPoint point) {return (DROPEFFECT)-1;}
virtual void OnDragLeave() {}
virtual DROPEFFECT OnDragScroll(DWORD dwKeyState, CPoint point) {return DROPEFFECT_NONE;}
} ;
// CFileDropTarget command target
class CFileDropTarget : public COleDropTarget
{
// DECLARE_DYNAMIC(CFileDropTarget)
private:
CDropTarget* m_pDropTarget;
public:
CFileDropTarget(CDropTarget* pDropTarget);
virtual ~CFileDropTarget();
protected:
DECLARE_MESSAGE_MAP()
DROPEFFECT OnDragEnter(CWnd* pWnd, COleDataObject* pDataObject, DWORD dwKeyState, CPoint point);
DROPEFFECT OnDragOver(CWnd* pWnd, COleDataObject* pDataObject, DWORD dwKeyState, CPoint point);
BOOL OnDrop(CWnd* pWnd, COleDataObject* pDataObject, DROPEFFECT dropEffect, CPoint point);
DROPEFFECT OnDropEx(CWnd* pWnd, COleDataObject* pDataObject, DROPEFFECT dropDefault, DROPEFFECT dropList, CPoint point);
void OnDragLeave(CWnd* pWnd);
DROPEFFECT OnDragScroll(CWnd* pWnd, DWORD dwKeyState, CPoint point);
} ;
#include
"
stdafx.h
"
#include " mplayerc.h "
#include " FileDropTarget.h "
// CFileDropTarget
// IMPLEMENT_DYNAMIC(CFileDropTarget, COleDropTarget)
CFileDropTarget::CFileDropTarget(CDropTarget * pDropTarget)
: m_pDropTarget(pDropTarget)
{
ASSERT(m_pDropTarget);
}
CFileDropTarget:: ~ CFileDropTarget()
{
}
DROPEFFECT CFileDropTarget::OnDragEnter(CWnd * pWnd, COleDataObject * pDataObject, DWORD dwKeyState, CPoint point)
{
return m_pDropTarget ? m_pDropTarget->OnDragEnter(pDataObject, dwKeyState, point) : DROPEFFECT_NONE;
}
DROPEFFECT CFileDropTarget::OnDragOver(CWnd * pWnd, COleDataObject * pDataObject, DWORD dwKeyState, CPoint point)
{
return m_pDropTarget ? m_pDropTarget->OnDragOver(pDataObject, dwKeyState, point) : DROPEFFECT_NONE;
}
BOOL CFileDropTarget::OnDrop(CWnd * pWnd, COleDataObject * pDataObject, DROPEFFECT dropEffect, CPoint point)
{
return m_pDropTarget ? m_pDropTarget->OnDrop(pDataObject, dropEffect, point) : DROPEFFECT_NONE;
}
DROPEFFECT CFileDropTarget::OnDropEx(CWnd * pWnd, COleDataObject * pDataObject, DROPEFFECT dropDefault, DROPEFFECT dropList, CPoint point)
{
return m_pDropTarget ? m_pDropTarget->OnDropEx(pDataObject, dropDefault, dropList, point) : DROPEFFECT_NONE;
}
void CFileDropTarget::OnDragLeave(CWnd * pWnd)
{
if(m_pDropTarget) m_pDropTarget->OnDragLeave();
}
DROPEFFECT CFileDropTarget::OnDragScroll(CWnd * pWnd, DWORD dwKeyState, CPoint point)
{
return m_pDropTarget ? m_pDropTarget->OnDragScroll(dwKeyState, point) : DROPEFFECT_NONE;
}
BEGIN_MESSAGE_MAP(CFileDropTarget, COleDropTarget)
END_MESSAGE_MAP()
// CFileDropTarget message handlers
#include " mplayerc.h "
#include " FileDropTarget.h "
// CFileDropTarget
// IMPLEMENT_DYNAMIC(CFileDropTarget, COleDropTarget)
CFileDropTarget::CFileDropTarget(CDropTarget * pDropTarget)
: m_pDropTarget(pDropTarget)
{
ASSERT(m_pDropTarget);
}
CFileDropTarget:: ~ CFileDropTarget()
{
}
DROPEFFECT CFileDropTarget::OnDragEnter(CWnd * pWnd, COleDataObject * pDataObject, DWORD dwKeyState, CPoint point)
{
return m_pDropTarget ? m_pDropTarget->OnDragEnter(pDataObject, dwKeyState, point) : DROPEFFECT_NONE;
}
DROPEFFECT CFileDropTarget::OnDragOver(CWnd * pWnd, COleDataObject * pDataObject, DWORD dwKeyState, CPoint point)
{
return m_pDropTarget ? m_pDropTarget->OnDragOver(pDataObject, dwKeyState, point) : DROPEFFECT_NONE;
}
BOOL CFileDropTarget::OnDrop(CWnd * pWnd, COleDataObject * pDataObject, DROPEFFECT dropEffect, CPoint point)
{
return m_pDropTarget ? m_pDropTarget->OnDrop(pDataObject, dropEffect, point) : DROPEFFECT_NONE;
}
DROPEFFECT CFileDropTarget::OnDropEx(CWnd * pWnd, COleDataObject * pDataObject, DROPEFFECT dropDefault, DROPEFFECT dropList, CPoint point)
{
return m_pDropTarget ? m_pDropTarget->OnDropEx(pDataObject, dropDefault, dropList, point) : DROPEFFECT_NONE;
}
void CFileDropTarget::OnDragLeave(CWnd * pWnd)
{
if(m_pDropTarget) m_pDropTarget->OnDragLeave();
}
DROPEFFECT CFileDropTarget::OnDragScroll(CWnd * pWnd, DWORD dwKeyState, CPoint point)
{
return m_pDropTarget ? m_pDropTarget->OnDragScroll(dwKeyState, point) : DROPEFFECT_NONE;
}
BEGIN_MESSAGE_MAP(CFileDropTarget, COleDropTarget)
END_MESSAGE_MAP()
// CFileDropTarget message handlers