Win7拖放:可以查出COleDataObject是否包含shell库吗?
我有一个带有文件和文件夹列表控件的应用程序,支持拖放操作。现在我想让用户能够将 Windows 7 库(例如音乐、图片等)放入此控件中。
在我的放置处理程序中,我有一个COleDataObject
,现在我试图找出库是否已放入控件中。由于该对象似乎不包含标准格式(例如 CF_HDROP
),因此我使用 COleDataObject::BeginEnumFormats
和 COleDataObject::GetNextFormat
枚举数据对象中的格式。我总共得到 5 种不同的 FORMATETC 结构。
以下是各个结构的 FORMATETC.cfFormat
和 FORMATETC.tymed
成员的列表:
- cfFormat = 0xc0a5,tymed = 0x1
- cfFormat = 0xc418,tymed = 0x1
- cfFormat = 0xc410,tymed = 0x1
- cfFormat = 0xc0fd,tymed = 0x4
- cfFormat = 0xc0fc,tymed = 0x1
谁能告诉我其中一个是否指向 shell 库并且如果是这样,我如何能够确定该库的解析名称?这些 cfFormat 值是否记录在某处?
最好的问候,
胡巴冈巴
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 be 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:
- cfFormat = 0xc0a5, tymed = 0x1
- cfFormat = 0xc418, tymed = 0x1
- cfFormat = 0xc410, tymed = 0x1
- cfFormat = 0xc0fd, tymed = 0x4
- 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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这些 MSDN 页面可能会有所帮助:
http://msdn。 microsoft.com/en-us/library/bb776902%28VS.85%29.aspx
http://msdn.microsoft.com/en- us/library/ff729168%28VS.85%29.aspx
他们没有您给出的确切格式值,但这应该是一个开始。
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.
使用
SHCreateShellItemArrayFromDataObject()
将数据对象转换为IShellItem
,您可以使用它来测试它们是否是库。在 MSDN 上了解更多信息。
Use
SHCreateShellItemArrayFromDataObject()
to convert the data object intoIShellItem
s, with which you can test to see if they are libraries.Read more on MSDN.