Writing a Windows Shell Extension similiar to the Assembly Cache Viewer

左心房为你撑大大i 提交于 2019-12-10 10:15:17

问题


I would like to write a shell extensions to completely customize the display of a particular folder, ala the Assembly Cache Viewer (browse to c:\windows\assembly and you will see what I mean). Which COM interfaces are responsible for providing these hooks? My 'viewer' will be written in C#...

Thanks!


回答1:


Here's an article that should get you on your way:

  • Create Namespace Extensions for Windows Explorer with the .NET Framework

Extending the Windows shell with namespace extensions allows you to create some custom functionality for Windows Explorer. One common use is to enable Explorer to present a list of items that do not exist in one real folder, but actually reside in a number of places. The view on the folder makes it look like these items are in one place, so managing them becomes easier. This article illustrates the process of creating custom shell namespace extensions using C# and the .NET Framework. [...]




回答2:


Note that there is controversy about doing explorer extensions in .NET.

Example problem: If you target .NET 2.0, then your extension won't work in any "open file" dialogs shown by .NET 1.1 applications. A process can load only one version of the .NET runtime.

It's not just a matter of your extension not working; you will be injecting a particular version of the .NET runtime into any application that uses file dialogs. That's bad news if the app is an unmanaged application that was planning on loading a COM component targetting a newer version of the .NET runtime, etc.

edit: as explained in the comment, this has now been solved by the .NET 4.0 runtime. Therefore, managed explorer extensions should always target .NET 4.0 or later.



来源:https://stackoverflow.com/questions/1408411/writing-a-windows-shell-extension-similiar-to-the-assembly-cache-viewer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!