分配键盘快捷键来获得在Windows资源管理器中选择项目的路径 [英] Assigning keyboard shortcut to get path of selected item in windows explorer

查看:164
本文介绍了分配键盘快捷键来获得在Windows资源管理器中选择项目的路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道这甚至有可能,但我怎么能结合一些组合键一(C#)程序,所以当在Windows资源管理器中选择一些文件被按下的键盘快捷方式,它会调用特定功能该文件作为参数的路径。

I don't know if this is even possible, but how can I bind some key combination to a (C#)program, so that when that keyboard shortcut is pressed with some file selected in windows explorer, it calls specific function with path of that file as a parameter.

或者,我可以指定一些键盘快捷键,这样Windows Explorer中打开选定的文件在我的程序(这样我可以传递给已经运行实例的路径)

Or can I assign some keyboard shortcut so that windows explorer opens selected file in my program(that way I could pass the path to already running instance)

感谢

推荐答案

您可以修改您的程序作为外壳扩展这将增加运行为你的程序在Windows资源管理器的右键菜单,但显然编码在C#的外壳扩展项目是一个的 想法

You could modify your program to run as a shell extension which would add an item for your program to the right-click menu in windows explorer, but apparently coding shell extensions in C# is a bad idea.

作为替代方案,通过少量的工作 AutoHotkey的可以做到这一点。 这里的当按下有些键盘组合,在重命名Windows资源管理器所选文件的示例脚本。你可以修改它来运行你的C#程序,并通过所选择的文件名。

As an alternative, with a little work AutoHotkey can do this. Here's a sample script that renames the selected file in Windows Explorer when a certain keyboard combination is pressed. You could modify it to run your C# program and pass the selected filename.

这篇关于分配键盘快捷键来获得在Windows资源管理器中选择项目的路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆