很精彩的博文OLE Drag&Drop,详细描述了ole拖放的相关知识。
枚举IDataObject支持的数据格式:
IEnumFORMATETC *pEnum;
if(SUCCEEDED(pDataObj->EnumFormatEtc(DATADIR_GET, &pEnum)))
{
ULONG celt=1, celtFetched;
FORMATETC fmt;
while (SUCCEEDED(pEnum->Next(celt, &fmt, &celtFetched)))
{
if (celt != celtFetched)
{
break;
}
TCHAR szFormatName[100];
if(GetClipboardFormatName(fmt.cfFormat, szFormatName, 100-1))
TRACE1("CLIPFORMAT:\t%s\n", szFormatName);
else
TRACE1("CLIPFORMAT:\t%d\n", fmt.cfFormat);
}
}
注册数据格式:
CF_FILEDESCRIPTOR = RegisterClipboardFormat(CFSTR_FILEDESCRIPTOR);
获得的值为49343。
枚举IDataObject支持的数据格式:


















注册数据格式:

红马天下 版权所有
博客:http://homer.cnblogs.com/
欢迎转载,但转载必须注明作者和出处。