如何在文件夹上注册属性处理程序? [英] How to register a Property Handler on folders?

查看:51
本文介绍了如何在文件夹上注册属性处理程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为Windows构建了一个虚拟文件系统(不是名称空间扩展名),它充当由文件和文件夹组成的文档管理服务器的前端。为了能够在Windows资源管理器中将DMS对象的某些元数据显示为其他可选列,我通过实现COM属性处理程序成功地向Windows属性系统提供了属性。 Wheras普通的属性处理程序专注于他们认为对它们负责的特定文件类型,我的属性处理程序将属性添加到所有文件,而不管它们的类型如何。因为属性处理程序只能在文件类型级别上注册,所以我为大约30种类型注册了处理程序。

I built a virtual filesystem (not a namespace extension) for Windows which acts as a frontend of our document management server consisting of files and folders. In order to be able to display some metadata of the DMS objects in Windows Explorer as additional selectable columns, I successfully provided properties to the Windows Property System by implementing a COM Property Handler. Wheras normal property handlers focus on specific file types for which they feel responsible, my Property Handler adds properties to all files regardless of their type. Because Property Handlers can only be registered on the file type level, I registered my handler for about 30 types under


HKLM\软件WMicrosoft\Windows\CurrentVersion\PropertySystem\PropertyHandlers\< .Extension>

但是,我没有设法为文件夹对象注册属性处理程序。由于文件系统中的所有对象都是虚拟的,因此我通过实现 IInitializeWithFile 而不是<$来构建属性存储( IPropertyStore ) c $ c> IInitializeWithStream 。这些属性是从我们的DMS请求的,路径中的 IInitializeWithFile 作为键,而不是从对象内容中读取的。这个概念也适用于文件夹。

However, I did not manage to register the Property Handler for folder objects. Since all objects in our file system are virtual I build the property store (IPropertyStore) by implementing IInitializeWithFile instead of IInitializeWithStream. The properties are requested from our DMS with the path of IInitializeWithFile acting as key and were not read from an objects content. This concept would work for folders as well.

为了在文件夹上被调用,我尝试通过在不同的知名标识符(如 Folder)下注册来关联处理程序。 目录 AllFileSystemObjects * 而不是文件扩展名没有成功。
我也没有在MSDN文档中找到与此相关的任何内容。

For getting called on folders I tried to associate the handler by registering under different well known identifiers like Folder, Directory, AllFileSystemObjects and * instead of the file extension without success. I also didn’t find anything in the MSDN documentation regarding this aspect.

是否可以在文件夹上注册Windows属性处理程序?还是有其他方法可以将自定义列添加到Windows资源管理器中的文件夹?

Is there a way to register a Windows Property Handler on folders? Or is there some other way to add custom columns to folders in Windows Explorer?

推荐答案

我不确定是否可以这样做。

I'm not sure if it is possible to do this.

属性处理程序显然不是正确的方法,它们是系统范围的,每个文件扩展名只能有一个。它们仅应由拥有软件的软件来实现。

Property handlers are clearly not the right approach, they are system wide and there can only be one per file extension. They should only be implemented by the software that "owns" the file extension and can parse the file to extract properties.

旧的列处理程序是最好的选择(IMHO),但是它们正式死了,您已经说过不能使用

The old column handlers would have been your best bet (IMHO) but they are officially dead and you already said you can't use them.

您是否考虑过创建名称空间扩展?是作为My Documents在2000 / XP中正常工作的某个地方(台式机或我的电脑)的根项目,还是其他类似OneDrive工作原理的东西?

Have you considered creating a namespace extension? Either as a root item somewhere (Desktop or My Computer) the way My Documents used to work in 2000/XP or maybe something more along the lines of how OneDrive works?

我不是确保desktop.ini文件在驱动器的根目录中在驱动器的根目录中工作,但是可能值得研究。然后,您将发现自己在 [。ShellClassInfo] 和其CLSID,CLSID2和UICLSID成员的记录不充分的土地。总体思路是在真实目录的顶部充当IShellFolder代理。 IShellFolder,因此您可以创建多重物业商店。我认为有一些(未记录?)属性键,您可以覆盖这些属性键以更改文件夹的默认列和工具提示。

I'm not sure if desktop.ini files work in the root of a drive but it might be worth looking into. You would then find yourself in the poorly documented land of [.ShellClassInfo] and its CLSID, CLSID2 and UICLSID members. The general idea would be to act as a IShellFolder proxy on top of the "real" IShellFolder so you could create a multiplex property store. I think there are some (undocumented?) property keys you can override to change the folders default columns and tooltips as well.

还有一种叫做委派的文件夹,它允许您使用嵌套的PIDL该文档再次变得毫无用处,所以我不确定这是否值得研究。

There is also something called a delegated folder that allows you to play with nested PIDLs but the documentation is once again pretty useless so I'm not sure if this is something worth looking into.

第三个选择是假装为云存储提供商。我不知道这是否使您更接近您的目标,您仍然需要实现一些NSE位,以便可以将自己置于基础IShellFolder的顶部。此功能是相当新的功能,仅在Windows 10上可用。

A 3rd option is to pretend to be a cloud storage provider. I don't know if this gets you any closer to your goal and you would still have to implement some NSE bits to get to the point where you can layer yourself on top of the underlying IShellFolder. This feature is rather new and only documented to work on Windows 10.

Explorer / IShellBrowser如何连接到IShellFolder / IShellView的内部工作原理是Windows上文档最少的部分之一。有数百个未记录的接口。资源管理器给予DefView特殊待遇其他第三方的实现很冷。

The inner workings of how Explorer/IShellBrowser is connected to the IShellFolder/IShellView is one of the least documented parts of Windows. There are hundreds of undocumented interfaces. Explorer gives DefView special treatment leaving other 3rd-party implementations out in the cold.

我的感觉是,没有一个干净的解决方案可以在驱动器号的顶部实现它,但是如果Raymond Chen放弃,您可能会很幸运。他可能会为您提供一些提示...

My feeling is that there is no clean solution to implement this on top of a drive letter but you might get lucky, if Raymond Chen drops by he might have some tips for you...

这篇关于如何在文件夹上注册属性处理程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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