是否可以继承默认的IShellFolder实现? [英] Is it possible to inherit the default IShellFolder implementation?

查看:884
本文介绍了是否可以继承默认的IShellFolder实现?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想实现一个外壳命名空间扩展,覆盖缩略图处理程序的唯一目的( IExtractImage )在一个特定的文件夹中。 我想一切是一样的普通文件夹,然后我宁愿没有重新实现了在的IShellFolder ...

I'm trying to implement a shell namespace extension, for the sole purpose of overriding the thumbnail handler (IExtractImage) in a specific folder. I want everything else to be the same as in a normal folder, and I'd rather not have to reimplement everything that is done in the default implementation of IShellFolder...

那么,是否可以继承这个默认实现?如果是这样,怎么样?

So, is it possible to inherit from this default implementation? If so, how?

使用成分也将是一个可以接受的解决办法,但我怎么能得到这个类的一个实例,对于一个给定文件夹?

Using composition would also be an acceptable solution, but how can I get an instance of the class for a given folder?

推荐答案

1)有很多shell扩展可以请求您的文件内容。例如.ico文件图标处理程序。另外用户可以安装例如信息提示扩展,它显示mp3文件的ID3标签,它也请求文件内容。用户可以在详细视图中设置其他列,其中一些请求文件内容。所以,你必须控制大量的在你的shell名字空间扩展的详细信息。

1) There many shell extensions which can request your files content. For example .ico-file icon handler. Also user can install for example info tip extension which shows ID3 tag from mp3 file and it requests file content too. User can setup additional columns in detail view and some of them request file content. So you must control a lot of details in your shell name space extension.

2)要创建一个默认的实现只是调用CoCreateInstance(CLSID_ShellFileSystemFolder,零,CLSCTX_INPROC_SERVER,IID_IShellFolder,ShellFolder )。

2) To create a default implementation just call CoCreateInstance(CLSID_ShellFileSystemFolder, nil, CLSCTX_INPROC_SERVER, IID_IShellFolder, ShellFolder).

3)有问题。例如:


  1. 壳牌从NSE查询未知IShellFolder3

  2. 您的NSE没有实现IShellFolder3和NSE从默认实现查询IShellFolder3并返回结果。

  3. 贝壳通话IShellFolder3.GetUIObject与IID_IExtractImage和默认IShellFolder3将返回安装缩略图的处理程序。

这样的方法可以导致AV内部资源管理器(从我的实践)。

Also such methods can lead to AV inside Explorer (from my practice).

所以我相信你的NSE必须实现所有已知接口由默认实现实现。如果你不想改变方法的行为只是传递参数到默认实现。已知的(由我)接口:IBrowserFrameOptions,IOleCommandTarget,的IPersist,IPersistIDList,IPersistFolder,IPersistFolder2,IPersistFolder3,IParentAndItem,的IShellFolder,IShellFolder2,IObjectWithFolderEnumMode,IShellDetails,IShellFolderViewCB,IFolderFilter,INameSpaceTreeControlFolderCapabilities,IShellIcon,IShellIconOverlay,IFolderType,IFolderViewSettings,IExplorerPaneVisibility,IPropertyStoreFactory,IPropertyStore ,IItemNameLimits,IThumbnailFactory

So I believe that your NSE must implement all known interfaces implemented by default implementation. If you don`t want to change behavior of method just pass the parameters to default implementation. Known (by me) interfaces: IBrowserFrameOptions, IOleCommandTarget, IPersist, IPersistIDList, IPersistFolder, IPersistFolder2, IPersistFolder3, IParentAndItem, IShellFolder, IShellFolder2, IObjectWithFolderEnumMode, IShellDetails, IShellFolderViewCB, IFolderFilter, INameSpaceTreeControlFolderCapabilities, IShellIcon, IShellIconOverlay, IFolderType, IFolderViewSettings, IExplorerPaneVisibility, IPropertyStoreFactory, IPropertyStore, IItemNameLimits, IThumbnailFactory.

4)据我了解,你必须控制以下接口的请求:IDataObject的,下降目标,IExtractIconA(W),IExtractImage,IPropertyStore,IPropertyStoreFactory,的IShellFolder( 2),IQueryInfo。

4) As i understand you must control requests of following interfaces: IDataObject, IDropTarget, IExtractIconA(W), IExtractImage, IPropertyStore, IPropertyStoreFactory, IShellFolder(2), IQueryInfo.

5)IShellIcon.GetIconOf必须返回扩展的默认图标。

5) IShellIcon.GetIconOf must return default icon of extension.

如果您的文件夹包含子文件夹不要忘记返回您的实现,当shell请求的子文件夹的IShellFolder(2)。

6) Also if your folder contains subfolders don`t forget to return your implementation when shell requests IShellFolder(2) of subfolder.

这篇关于是否可以继承默认的IShellFolder实现?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆