如何获取上下文菜单选择的路径?
我在 Internet Explorer 的上下文菜单上有一个自定义条目。 我想对所选项目执行一些操作,例如,运行一个接收该选择作为 ARGV[1] 的程序。
例如,如果我右键单击桌面上名为 whatever.zip
的文件,则应运行以下内容: my_binary 路径\to\desktop\whatever.zip
I have a custom entry on the Internet Explorer's context menu. I would like to do something with the selected item, for example, run a program that receives that selection as ARGV[1].
For example, if I right click on a file named whatever.zip
that is located on my desktop, the following thing should run :
my_binary path\to\desktop\whatever.zip
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要更改 YOUR_BINARY 和文件类型来执行某些操作:
创建一个名为 RegisterYourBinary.reg 的文件,其内容为:
You need change YOUR_BINARY and the filetype to do something:
Create a file called RegisterYourBinary.reg with the content:
调用可执行文件时,从资源管理器上下文菜单中添加 %L 作为参数。
例如:
myApp.exe %L
add %L as argument from within the explorer context menu when calling your executable.
For example:
myApp.exe %L