简体   繁体   English

将上下文菜单项添加到Windows资源管理器

[英]Adding a context menu item to windows explorer

I've been searching for days about this, but haven't found anything. 我一直在寻找这个,但没有找到任何东西。 I am trying to find out how I can add a context menu item to the windows explorer. 我试图找出如何将上下文菜单项添加到Windows资源管理器。 I do not want it for specific filetypes, BUT I want it to appear on everything inside a specific path. 我不希望它用于特定的文件类型,但我希望它出现在特定路径内的所有内容中。 For example, I want right-click menus of anything inside "C:\\folder" to contain this item, but it shouldn't appear outside this folder... 例如,我想要在“C:\\ folder”中的任何内容的右键菜单包含此项目,但它不应出现在此文件夹之外...

Is that possible? 那可能吗? Any help will be really appreciated! 任何帮助将非常感谢!

Thanks in advance, John. 先谢谢你,约翰。

The normal way this is achieved is to add it to the Registry under: 实现这一目标的正常方法是将其添加到注册表中:

HKEY_LOCAL_MACHINE/Software/Classes/Folder/Shell

However in your specific case you want to do some preprocessing before it is displayed (eg is it in the specified directory) which wouldn't work with a simple registry alteration. 但是,在您的特定情况下,您希望在显示之前进行一些预处理(例如,它是否在指定的目录中),这对于简单的注册表更改无效。

I think there is a way to force you way into any operation and add a hook to it. 我认为有一种方法可以强制你进入任何操作并添加一个钩子。 I'm talking about old school knowledge now though and I cannot think what the technology would be called. 我现在正在谈论旧学校的知识,我无法想象这项技术会被称为什么。 I think its how you would have, for example, forced your way into the rendering engine to put custom skins on normal explorer windows or inject an extra button into the title bar of apps like you used to see back in the day. 例如,我认为你会如何强制进入渲染引擎,将自定义皮肤放在普通的资源管理器窗口上,或者在应用程序的标题栏中注入一个额外的按钮,就像你过去看到的一样。

It just occurred to me that adding a button to the windows title bar might have given a search starting point, I found this article which refers to subclassing windows components and injecting your own behaviour. 我刚刚想到在窗口标题栏上添加一个按钮可能会给出一个搜索起点,我发现这篇文章指的是对windows组件进行子类化并注入自己的行为。 I think that is what I'm talking about above: 我认为这就是我上面所说的:

Hope this gives you a new direction to search in. 希望这能为您提供一个新的搜索方向。

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

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