很精彩的博文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。
posted on 2008-04-29 11:00  红马天下  阅读(334)  评论(0编辑  收藏  举报