需要写一个shell扩展
我需要为一个小的上下文菜单编写一个 shell 扩展。 不幸的是,我重用了使用.net 4.0的开源代码,
现在的问题是要求我不应该使用.NET 4.0。
相反,有一种方法可以让我在注册表中创建一个条目,以便弹出外壳扩展
我的要求是...... 1. shell 扩展上下文菜单应仅在 .txt、.csv、.xls 文件上显示。 2. 单击 shell 扩展后,我需要启动一个不同的进程,将我们单击的文件的全名作为参数传递给该进程。
I need to write a shell extension for a small context menu.
unfortunately i reused the code available in open source which uses .net 4.0
now the problem is the requirement is I shud not use .NET 4.0.
Instead is there a way where in I can make an entry in the registry so that the shell extension pops out
My requirement is ....
1. The shell extension context menu should display only on .txt, .csv, .xls files.
2. Upon click of shell extension I need to start a different process, by passing the full name of the file on which we click as parameter to the process.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您只想向某些文件类型的上下文菜单添加项目,并作为响应启动外部应用程序,则无需编写 shell 扩展。注册表项足以表达这一点。
正如 http://www.jfitz.com/tips/rclick_custom.html 文章您链接到说,对于要操作的每种文件类型,您需要在 Shell 子项下添加一个新的注册表项,然后创建一个名为 command 的子项,其值是要启动的应用程序的名称。
要将您单击的文件的名称传递到此外部应用程序,请将“%1”添加到命令中。包含引号,这样如果文件名包含空格,接收程序仍将其视为一个标记。
If you just want to add items to the context menu for certain file types, and in response launch an external application, you don't need to write a shell extension. Registry entries are enough to express this.
As the http://www.jfitz.com/tips/rclick_custom.html article you linked to says, for each file type you want to act on, you need to add a new registry key under the Shell subkey, then create a subkey called command, whose value is the name of the application to launch.
To pass the name of the file you clicked on to this external application, add "%1" to the command. Include the quotes, so that if the file's name contains spaces, it will still be treated as one token by the receiving program.