外部托拽文件时,在目标区域改变光标图像,实现部分区域可以拖放。
2007-05-08 14:37
661 查看
UnitTMyDropTarget.h文件代码
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//---------------------------------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#ifndef UnitTMyDropTargetH
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#define UnitTMyDropTargetH
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//---------------------------------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include "oleidl.h"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include "controls.hpp"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//---------------------------------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
class TMyDropTarget: public IDropTarget
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
public:
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
__property void __fastcall (__closure *OnGetFormat)(IDropTarget *Sender, IDataObject *DataObject, DWORD KeyState, TPoint pt, DWORD &dpe, bool &bDataOK) = ...{ read=_FGetFormat, write=_FGetFormat };
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
__property void __fastcall (__closure *OnProcessData)(IDropTarget *Sender, IDataObject *DataObject, DWORD KeyState, TPoint pt) = ...{ read=_FProcessData, write=_FProcessData };
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
__property void __fastcall (__closure *OnDragOver)(void) = ...{ read=_FOnDragOver, write=_FOnDragOver };
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
__property void __fastcall (__closure *OnProcessText)(IDropTarget *Sender, AnsiString AText, DWORD KeyState, TPoint pt) = ...{ read=_FProcessText, write=_FProcessText };
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
TMyDropTarget(TWinControl *AOwner);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
~TMyDropTarget();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
HRESULT __stdcall QueryInterface(const GUID &iid, void **ppv);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
ULONG __stdcall AddRef(void) ...{ return ++_iRefCount; }
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
ULONG __stdcall Release(void) ...{ if(--_iRefCount==0)...{delete this;} return _iRefCount; }
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
HRESULT __stdcall DragEnter(IDataObject *pDataObject, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// –{•¶?Ž© C++Builder Œ¤‹† - http://www.ccrun.com/article.asp?i=490&d=4775gq
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
HRESULT __stdcall DragOver(DWORD grfKeyState, POINTL pt, DWORD *pdwEffect);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
HRESULT __stdcall DragLeave(void);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
HRESULT __stdcall Drop(IDataObject *pDataObject, DWORD grfKeyState, POINTL pt, DWORD * pdwEffect);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private:
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
ULONG _iRefCount;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
IDataObject *_lpDataObj;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
TWinControl *_OwnerControl;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
void __fastcall (__closure *_FOnDragOver)(void);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
void __fastcall (__closure *_FGetFormat)(IDropTarget *Sender, IDataObject *DataObject, DWORD KeyState, TPoint pt, DWORD &dpe, bool &bDataOK);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
void __fastcall (__closure *_FProcessData)(IDropTarget *Sender, IDataObject *DataObject, DWORD KeyState, TPoint pt);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
void __fastcall (__closure *_FProcessText)(IDropTarget *Sender, AnsiString AText, DWORD KeyState, TPoint pt);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
bool __fastcall FDataFormatOK(DWORD KeyState, POINTL pt, DWORD &dpe);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
void __fastcall FProcessData(DWORD KeyState, POINTL pt);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
};
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//---------------------------------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#endif
UnitTMyDropTarget.cpp代码
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//---------------------------------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#pragma hdrstop
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include "UnitTMyDropTarget.h"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//---------------------------------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#pragma package(smart_init)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//---------------------------------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
TMyDropTarget::TMyDropTarget(TWinControl *AOwner)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
_OwnerControl = AOwner;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
_iRefCount = 0;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
_lpDataObj = NULL;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
_FGetFormat = NULL;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
_FProcessData = NULL;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
_FProcessText = NULL;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
RegisterDragDrop(_OwnerControl->Handle,this);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//---------------------------------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
TMyDropTarget::~TMyDropTarget()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
RevokeDragDrop(_OwnerControl->Handle);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//---------------------------------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
HRESULT __stdcall TMyDropTarget::QueryInterface(const GUID &iid, void **ppv)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if((iid==IID_IUnknown)||(iid==IID_IDropTarget))
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
*ppv=this;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
AddRef();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
else
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
*ppv=NULL;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return E_NOINTERFACE;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return S_OK;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//---------------------------------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
HRESULT __stdcall TMyDropTarget::DragEnter(IDataObject *pDataObject, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
_lpDataObj = pDataObject;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
FDataFormatOK(grfKeyState,pt,*pdwEffect);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return S_OK;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//---------------------------------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
HRESULT __stdcall TMyDropTarget::DragOver(DWORD grfKeyState, POINTL pt, DWORD *pdwEffect)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(pt.x > 300)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
pdwEffect = 0;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
FDataFormatOK(grfKeyState,pt,*pdwEffect);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
if(_FOnDragOver)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
_FOnDragOver();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return S_OK;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//---------------------------------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
HRESULT __stdcall TMyDropTarget::DragLeave(void)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return S_OK;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//---------------------------------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
HRESULT __stdcall TMyDropTarget::Drop(IDataObject *pDataObject, DWORD grfKeyState, POINTL pt, DWORD * pdwEffect)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
_lpDataObj = pDataObject;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(FDataFormatOK(grfKeyState,pt,*pdwEffect))
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
FProcessData(grfKeyState,pt);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return S_OK;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//---------------------------------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
bool __fastcall TMyDropTarget::FDataFormatOK(DWORD KeyState, POINTL pt, DWORD &dpe)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
FORMATETC fetc=...{CF_TEXT,0,DVASPECT_CONTENT,-1,DWORD(-1)};
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
bool bOK=_lpDataObj->QueryGetData(&fetc)==S_OK;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
dpe = bOK?DROPEFFECT_COPY:DROPEFFECT_NONE;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(_FGetFormat)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
TPoint point(pt.x,pt.y);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
::ScreenToClient(_OwnerControl->Handle,&point);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
_FGetFormat(this,_lpDataObj,KeyState,point,dpe,bOK);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return bOK;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//---------------------------------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
void __fastcall TMyDropTarget::FProcessData(DWORD KeyState, POINTL pt)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(_FProcessData)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
TPoint point(pt.x,pt.y);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
::ScreenToClient(_OwnerControl->Handle,&point);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
_FProcessData(this,_lpDataObj,KeyState,point);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
else if(_FProcessText)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
STGMEDIUM smed;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
FORMATETC fetc=...{CF_TEXT,0,DVASPECT_CONTENT,-1,DWORD(-1)};
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
BOOL bValue=(_lpDataObj->GetData(&fetc,&smed)==S_OK);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(bValue)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
HGLOBAL hData = GlobalLock(smed.hGlobal);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(hData)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
TPoint point(pt.x,pt.y);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
::ScreenToClient(_OwnerControl->Handle,&point);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
_FProcessText(this,(char*)hData,KeyState,point);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
GlobalUnlock(hData);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
GlobalFree(hData);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//---------------------------------------------------------------------------
Unit1.h
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//---------------------------------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#ifndef Unit1H
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#define Unit1H
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//---------------------------------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include <Classes.hpp>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include <Controls.hpp>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include <StdCtrls.hpp>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include <Forms.hpp>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include "UnitTMyDropTarget.h"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//---------------------------------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
class TForm1 : public TForm
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
__published: // IDE-managed Components
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
TMemo *Memo1;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private: // User declarations
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
TMyDropTarget *DropMemo1; //Ž©’è?“I?•ú–Ú??
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
HCURSOR hCursor;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
bool DropEnable;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
void __fastcall DropMemo1Text(IDropTarget *Sender, AnsiString AText, DWORD KeyState, TPoint pt); //?•úŽ–Œ
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
void __fastcall DragOverCursor(void);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
public: // User declarations
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
__fastcall TForm1(TComponent* Owner);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
__fastcall ~TForm1();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
};
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//---------------------------------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
extern PACKAGE TForm1 *Form1;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//---------------------------------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#endif
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Unit1.cpp
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//---------------------------------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include <vcl.h>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#pragma hdrstop
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include "Unit1.h"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include "winuser.h"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//---------------------------------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#pragma package(smart_init)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#pragma resource "*.dfm"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
TForm1 *Form1;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//---------------------------------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
__fastcall TForm1::TForm1(TComponent* Owner)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
: TForm(Owner)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
OleInitialize(NULL);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
DropMemo1 = new TMyDropTarget(Memo1);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
DropMemo1->OnProcessText = DropMemo1Text;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
DropMemo1->OnDragOver = DragOverCursor;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
hCursor = LoadCursor(HInstance,"IDC_ARROW");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
DropEnable = true;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//---------------------------------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
__fastcall TForm1::~TForm1()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
DropMemo1->Release();//delete DropMemo1;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
OleUninitialize();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//---------------------------------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
void __fastcall TForm1::DropMemo1Text(IDropTarget *Sender, AnsiString AText, DWORD KeyState, TPoint pt)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
POINTS p=...{pt.x,pt.y};
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
*(long*)&p=SendMessage(Memo1->Handle,EM_CHARFROMPOS,0,*(long*)&p);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Memo1->SelStart = p.x;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Memo1->SelLength = 0;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Memo1->SelText = AText;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//---------------------------------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
void __fastcall TForm1::DragOverCursor()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//::SetCursor(hCursor);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
/**//*
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
RevokeDragDrop(Memo1->Handle);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
DropMemo1 = new TMyDropTarget(Memo1);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
DropMemo1->OnProcessText = DropMemo1Text ;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
*/
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//---------------------------------------------------------------------------
心得以后补上,关键是修改TMyDropTarget::DragOver中pdwEffect的值为0 便可部分区域不能拖拽。
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//---------------------------------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#ifndef UnitTMyDropTargetH
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#define UnitTMyDropTargetH
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//---------------------------------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include "oleidl.h"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include "controls.hpp"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//---------------------------------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
class TMyDropTarget: public IDropTarget
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
public:
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
__property void __fastcall (__closure *OnGetFormat)(IDropTarget *Sender, IDataObject *DataObject, DWORD KeyState, TPoint pt, DWORD &dpe, bool &bDataOK) = ...{ read=_FGetFormat, write=_FGetFormat };
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
__property void __fastcall (__closure *OnProcessData)(IDropTarget *Sender, IDataObject *DataObject, DWORD KeyState, TPoint pt) = ...{ read=_FProcessData, write=_FProcessData };
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
__property void __fastcall (__closure *OnDragOver)(void) = ...{ read=_FOnDragOver, write=_FOnDragOver };
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
__property void __fastcall (__closure *OnProcessText)(IDropTarget *Sender, AnsiString AText, DWORD KeyState, TPoint pt) = ...{ read=_FProcessText, write=_FProcessText };
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
TMyDropTarget(TWinControl *AOwner);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
~TMyDropTarget();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
HRESULT __stdcall QueryInterface(const GUID &iid, void **ppv);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
ULONG __stdcall AddRef(void) ...{ return ++_iRefCount; }
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
ULONG __stdcall Release(void) ...{ if(--_iRefCount==0)...{delete this;} return _iRefCount; }
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
HRESULT __stdcall DragEnter(IDataObject *pDataObject, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// –{•¶?Ž© C++Builder Œ¤‹† - http://www.ccrun.com/article.asp?i=490&d=4775gq
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
HRESULT __stdcall DragOver(DWORD grfKeyState, POINTL pt, DWORD *pdwEffect);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
HRESULT __stdcall DragLeave(void);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
HRESULT __stdcall Drop(IDataObject *pDataObject, DWORD grfKeyState, POINTL pt, DWORD * pdwEffect);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private:
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
ULONG _iRefCount;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
IDataObject *_lpDataObj;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
TWinControl *_OwnerControl;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
void __fastcall (__closure *_FOnDragOver)(void);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
void __fastcall (__closure *_FGetFormat)(IDropTarget *Sender, IDataObject *DataObject, DWORD KeyState, TPoint pt, DWORD &dpe, bool &bDataOK);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
void __fastcall (__closure *_FProcessData)(IDropTarget *Sender, IDataObject *DataObject, DWORD KeyState, TPoint pt);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
void __fastcall (__closure *_FProcessText)(IDropTarget *Sender, AnsiString AText, DWORD KeyState, TPoint pt);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
bool __fastcall FDataFormatOK(DWORD KeyState, POINTL pt, DWORD &dpe);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
void __fastcall FProcessData(DWORD KeyState, POINTL pt);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
};
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//---------------------------------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#endif
UnitTMyDropTarget.cpp代码
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//---------------------------------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#pragma hdrstop
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include "UnitTMyDropTarget.h"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//---------------------------------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#pragma package(smart_init)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//---------------------------------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
TMyDropTarget::TMyDropTarget(TWinControl *AOwner)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
_OwnerControl = AOwner;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
_iRefCount = 0;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
_lpDataObj = NULL;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
_FGetFormat = NULL;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
_FProcessData = NULL;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
_FProcessText = NULL;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
RegisterDragDrop(_OwnerControl->Handle,this);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//---------------------------------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
TMyDropTarget::~TMyDropTarget()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
RevokeDragDrop(_OwnerControl->Handle);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//---------------------------------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
HRESULT __stdcall TMyDropTarget::QueryInterface(const GUID &iid, void **ppv)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if((iid==IID_IUnknown)||(iid==IID_IDropTarget))
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
*ppv=this;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
AddRef();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
else
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
*ppv=NULL;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return E_NOINTERFACE;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return S_OK;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//---------------------------------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
HRESULT __stdcall TMyDropTarget::DragEnter(IDataObject *pDataObject, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
_lpDataObj = pDataObject;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
FDataFormatOK(grfKeyState,pt,*pdwEffect);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return S_OK;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//---------------------------------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
HRESULT __stdcall TMyDropTarget::DragOver(DWORD grfKeyState, POINTL pt, DWORD *pdwEffect)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(pt.x > 300)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
pdwEffect = 0;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
FDataFormatOK(grfKeyState,pt,*pdwEffect);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
if(_FOnDragOver)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
_FOnDragOver();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return S_OK;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//---------------------------------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
HRESULT __stdcall TMyDropTarget::DragLeave(void)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return S_OK;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//---------------------------------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
HRESULT __stdcall TMyDropTarget::Drop(IDataObject *pDataObject, DWORD grfKeyState, POINTL pt, DWORD * pdwEffect)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
_lpDataObj = pDataObject;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(FDataFormatOK(grfKeyState,pt,*pdwEffect))
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
FProcessData(grfKeyState,pt);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return S_OK;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//---------------------------------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
bool __fastcall TMyDropTarget::FDataFormatOK(DWORD KeyState, POINTL pt, DWORD &dpe)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
FORMATETC fetc=...{CF_TEXT,0,DVASPECT_CONTENT,-1,DWORD(-1)};
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
bool bOK=_lpDataObj->QueryGetData(&fetc)==S_OK;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
dpe = bOK?DROPEFFECT_COPY:DROPEFFECT_NONE;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(_FGetFormat)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
TPoint point(pt.x,pt.y);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
::ScreenToClient(_OwnerControl->Handle,&point);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
_FGetFormat(this,_lpDataObj,KeyState,point,dpe,bOK);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return bOK;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//---------------------------------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
void __fastcall TMyDropTarget::FProcessData(DWORD KeyState, POINTL pt)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(_FProcessData)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
TPoint point(pt.x,pt.y);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
::ScreenToClient(_OwnerControl->Handle,&point);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
_FProcessData(this,_lpDataObj,KeyState,point);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
else if(_FProcessText)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
STGMEDIUM smed;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
FORMATETC fetc=...{CF_TEXT,0,DVASPECT_CONTENT,-1,DWORD(-1)};
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
BOOL bValue=(_lpDataObj->GetData(&fetc,&smed)==S_OK);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(bValue)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
HGLOBAL hData = GlobalLock(smed.hGlobal);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(hData)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
TPoint point(pt.x,pt.y);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
::ScreenToClient(_OwnerControl->Handle,&point);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
_FProcessText(this,(char*)hData,KeyState,point);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
GlobalUnlock(hData);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
GlobalFree(hData);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//---------------------------------------------------------------------------
Unit1.h
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//---------------------------------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#ifndef Unit1H
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#define Unit1H
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//---------------------------------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include <Classes.hpp>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include <Controls.hpp>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include <StdCtrls.hpp>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include <Forms.hpp>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include "UnitTMyDropTarget.h"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//---------------------------------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
class TForm1 : public TForm
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
__published: // IDE-managed Components
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
TMemo *Memo1;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private: // User declarations
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
TMyDropTarget *DropMemo1; //Ž©’è?“I?•ú–Ú??
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
HCURSOR hCursor;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
bool DropEnable;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
void __fastcall DropMemo1Text(IDropTarget *Sender, AnsiString AText, DWORD KeyState, TPoint pt); //?•úŽ–Œ
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
void __fastcall DragOverCursor(void);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
public: // User declarations
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
__fastcall TForm1(TComponent* Owner);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
__fastcall ~TForm1();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
};
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//---------------------------------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
extern PACKAGE TForm1 *Form1;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//---------------------------------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#endif
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Unit1.cpp
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//---------------------------------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include <vcl.h>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#pragma hdrstop
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include "Unit1.h"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include "winuser.h"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//---------------------------------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#pragma package(smart_init)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#pragma resource "*.dfm"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
TForm1 *Form1;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//---------------------------------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
__fastcall TForm1::TForm1(TComponent* Owner)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
: TForm(Owner)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
OleInitialize(NULL);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
DropMemo1 = new TMyDropTarget(Memo1);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
DropMemo1->OnProcessText = DropMemo1Text;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
DropMemo1->OnDragOver = DragOverCursor;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
hCursor = LoadCursor(HInstance,"IDC_ARROW");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
DropEnable = true;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//---------------------------------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
__fastcall TForm1::~TForm1()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
DropMemo1->Release();//delete DropMemo1;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
OleUninitialize();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//---------------------------------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
void __fastcall TForm1::DropMemo1Text(IDropTarget *Sender, AnsiString AText, DWORD KeyState, TPoint pt)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
POINTS p=...{pt.x,pt.y};
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
*(long*)&p=SendMessage(Memo1->Handle,EM_CHARFROMPOS,0,*(long*)&p);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Memo1->SelStart = p.x;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Memo1->SelLength = 0;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Memo1->SelText = AText;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//---------------------------------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
void __fastcall TForm1::DragOverCursor()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//::SetCursor(hCursor);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
/**//*
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
RevokeDragDrop(Memo1->Handle);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
DropMemo1 = new TMyDropTarget(Memo1);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
DropMemo1->OnProcessText = DropMemo1Text ;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
*/
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//---------------------------------------------------------------------------
心得以后补上,关键是修改TMyDropTarget::DragOver中pdwEffect的值为0 便可部分区域不能拖拽。
相关文章推荐
- 实现一个可以在队列满时,将溢出的部分缓存入文件,待空闲时取出的队列
- WPF中控件绑定XML文件,实现修改XML文件即可以改变程序控件内容
- 直接可以用的Python和OpenCV检测及分割图像的目标区域例子
- 改变HSV的H和V部分(比如可以增加图像亮度)
- 基于GDI PLUS实现外部图像文件设置/绘制窗口图像
- 服务器文件自动打包备份到电脑,可以通过flashfxp及电脑的计划任务实现
- 图像目标区域质心计算
- JS实现用特殊符号替换字符串的中间部分区域的实例代码
- 实现一个可以动态改变的N层导航树
- [原创]JAAS 实现in Struts Web App,使用XMLPolicy文件,不改变VM安全配置(1)认证
- PHP实现提取一个图像文件并在浏览器上显示的代码
- 实现二值图像连通区标记之区域生长法
- 串口传文件(非终端串口,自己定协议下位机部分C语言实现)
- 让spring的配置文件可以使用外部properties里的参数。
- 用java实现外部调用exe文件
- 提取gz文件中的压缩部分数据,C语言实现
- Android UI开发第四十二篇——实现实现易信的圆形图像和对话列表的图像显示部分
- iPhone 如何实现静态库文件 .a 在模拟器和真机下都可以使用
- Android实现点击通知栏后,先启动应用再打开目标Activity ,极光推送等推送的也可以参考一下(转)