简体   繁体   English

Windows Shell是否支持多个Shell属性处理程序?

[英]Does the Windows shell support multiple shell property handlers?

I was just trying out the Windows app sample for the Recipe Property Handler which is available here and I modified it to be used on .doc files instead of .recipe files: 我刚刚尝试了可在此处使用的配方属性处理程序的Windows应用程序示例,并对其进行了修改,以用于.doc文件而不是.recipe文件:

const WCHAR c_szRecipeFileExtension[] = L".doc";

But, this seemed to overwrite the previous Office handler's properties with itself, which begs the question, does the Windows shell support multiple shell property handlers, or can you only use one at a time for a given file type? 但是,这似乎会覆盖以前的Office处理程序的属性本身,这引出了一个问题,Windows Shell是否支持多个Shell属性处理程序,或者一次只能为一个给定的文件类型使用一个? If its possible, what am I missing from the code or logic in the sample? 如果可能,样本中的代码或逻辑中我缺少什么?

I couldn't find a concrete answer on MSDN for this question. 对于这个问题,我在MSDN上找不到具体答案。

No. 没有。

But there is a variant you can use (I dont like it but I dont see any additional variant). 但是您可以使用一个变体(我不喜欢它,但看不到任何其他变体)。 Save previous Property handler CLSID when you register your own. 注册自己的属性时,请保存以前的属性处理程序CLSID。 And when shell request the property that you cannot process - just create instance of previous handler and pass request to them. 当shell请求无法处理的属性时,只需创建先前处理程序的实例并将请求传递给它们即可。

CoCreateInstance(SavedCLSID, nil, CLSCTX_INPROC_SERVER or CLSCTX_LOCAL_SERVER, IPropertyStore, PS)
PS.QueryInterface(IInitializeWithStream, IWS)
IWS.Initialize(Stream, Mode)
PS.GetValue(AUnknownKey)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM