www.pudn.com > ShortCutEx.rar > DropTarget.h, change:2004-07-30,size:1978b


// DropTarget.h: interface for the CDropTarget class. 
// 
////////////////////////////////////////////////////////////////////// 
 
#if !defined(AFX_DROPTARGET_H__4C619BAB_37EA_4F36_81C1_110AE30872DB__INCLUDED_) 
#define AFX_DROPTARGET_H__4C619BAB_37EA_4F36_81C1_110AE30872DB__INCLUDED_ 
 
#if _MSC_VER > 1000 
#pragma once 
#endif // _MSC_VER > 1000 
 
#include <oleidl.h> 
#include <shlobj.h> 
 
class CDropTarget : public IDropTarget   
{ 
public: 
	CDropTarget(HWND hWnd); 
	virtual ~CDropTarget(); 
 
public: 
	virtual HRESULT STDMETHODCALLTYPE QueryInterface(  
		/* [in] */ REFIID riid, 
		/* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject); 
	virtual ULONG STDMETHODCALLTYPE AddRef( void) { return ++m_cRefCount; } 
	virtual ULONG STDMETHODCALLTYPE Release( void); 
 
	virtual HRESULT STDMETHODCALLTYPE DragEnter( 
        /* [unique][in] */ IDataObject __RPC_FAR *pDataObj, 
        /* [in] */ DWORD grfKeyState, 
        /* [in] */ POINTL pt, 
        /* [out][in] */ DWORD __RPC_FAR *pdwEffect); 
    virtual HRESULT STDMETHODCALLTYPE DragOver(  
        /* [in] */ DWORD grfKeyState, 
        /* [in] */ POINTL pt, 
        /* [out][in] */ DWORD __RPC_FAR *pdwEffect); 
    virtual HRESULT STDMETHODCALLTYPE DragLeave( void);     
    virtual HRESULT STDMETHODCALLTYPE Drop( 
        /* [unique][in] */ IDataObject __RPC_FAR *pDataObj, 
        /* [in] */ DWORD grfKeyState, 
        /* [in] */ POINTL pt, 
        /* [out][in] */ DWORD __RPC_FAR *pdwEffect); 
 
	bool QueryDrop(DWORD grfKeyState, LPDWORD pdwEffect); 
	void AddSuportedFormat(FORMATETC& ftetc) { m_formatetc.Add(ftetc); }; 
	virtual bool OnDrop(FORMATETC* pFmtEtc, STGMEDIUM& medium, DWORD *pdwEffect) = 0; 
	 
protected: 
	HWND m_hTargetWnd; 
	DWORD m_cRefCount; 
	bool m_bAllowDrop; 
	IDropTargetHelper *m_pDropTargetHelper; 
	CSimpleArray<FORMATETC> m_formatetc; 
	FORMATETC*	m_pSupportedFrmt; 
}; 
 
#endif // !defined(AFX_DROPTARGET_H__4C619BAB_37EA_4F36_81C1_110AE30872DB__INCLUDED_)