Code : Tout sélectionner
;Ole Drag/Drop far from finished
;-Structures/Interfaces
Structure Formatetc
cfFormat.l ; // Clipboard format
*ptd ; // (NULL) Target device for rendering
dwAspect.l ; // (DV_CONTENT) How much detail is required for data rendering
lindex.l ; // (-1) Used when data is split across page boundaries
tymed.l ; // Storage medium used for data transfer (HGLOBAL, IStream etc)
EndStructure
Structure STGMedium
tymed.l ;
lpszFileName.l ;
*pUnkForRelease ;
EndStructure
Interface IDropSource
QueryInterface(a,b)
AddRef()
Release()
EndInterface
;-IDataObject Interface
DeclareCDLL GetData(*pFormatEtc,*pmedium);
DeclareCDLL GetDataHere(*pFormatEtc,*pmedium);
DeclareCDLL QueryGetData(*pFormatEtc);
DeclareCDLL GetCanonicalFormatEtc(*pFormatEct,*pFormatEtcOut);
DeclareCDLL SetData(*pFormatEtc,*pmedium,fRelease);
DeclareCDLL EnumFormatEtc(dwDirection,*ppEnumFormatEtc);
DeclareCDLL DAdvise(*pFormatEtc,dwadvf, IAdviseSink,*dw);
DeclareCDLL DUnadvise(dwConnection);
DeclareCDLL EnumDAdvise(*ppEnumAdvise);
;-IDataObject Implementation
;????????????????????????????????????????????????????;
;First of all -> How to construct oDataObject????????;
;The rest of the implementation I think I can manage.;
;????????????????????????????????????????????????????;
Global *pDataObject.IDataObject
Global *pDropSource.IDropSource
Global myFormatetc.Formatetc
Global myStgmed.STGMedium
myFormatetc\cfFormat=#cf_wave
myFormatetc\lindex=-1
;?????myStgmed\tymed=#tymed_hglobal ;?????
;-Initialize OLE
If OleInitialize_(0) <> #S_OK
MessageRequester("OLE","Unable to initialize OLE")
Else
dodragdrop_(*pDataObject,*pDataSource,0,0)
*pDataObject\Release();
OleUninitialize_();
EndIf