开发者

Win7 Drag&Drop: Possible to find out if COleDataObject contains shell library?

I have an application with a file and folder list control which supports Drag&Drop operations. Now I would like to make it possible for the user to b开发者_高级运维e able to drop a Windows 7 Library (e.g. Music, Pictures and so on) into this control.

In my drop handler I have a COleDataObject and now I'm trying to find out, if a library has been dropped into the control. Since the object does not seem to contain a standard format (e.g. CF_HDROP), I'm using COleDataObject::BeginEnumFormats and COleDataObject::GetNextFormat to enumerate the formats in the data object. I get a total of 5 different FORMATETC structures.

Here's a list of the FORMATETC.cfFormat and FORMATETC.tymed members of the individual structures:

  1. cfFormat = 0xc0a5, tymed = 0x1
  2. cfFormat = 0xc418, tymed = 0x1
  3. cfFormat = 0xc410, tymed = 0x1
  4. cfFormat = 0xc0fd, tymed = 0x4
  5. cfFormat = 0xc0fc, tymed = 0x1

Can anyone tell me if one of them is pointing to a shell library and if so, how I would be able to e.g. determine the parsing name of this library? Are these cfFormat values perhaps documented somewhere?

Best regards,

humbagumba


These MSDN pages might help:

http://msdn.microsoft.com/en-us/library/bb776902%28VS.85%29.aspx http://msdn.microsoft.com/en-us/library/ff729168%28VS.85%29.aspx

They don't have the exact format values you've given, but it should be a start.


Use SHCreateShellItemArrayFromDataObject() to convert the data object into IShellItems, with which you can test to see if they are libraries.

Read more on MSDN.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜