c#wpf在Windows的右键单击上下文菜单中设置链接 [英] c# wpf set link in the right-click context menu of windows

查看:46
本文介绍了c#wpf在Windows的右键单击上下文菜单中设置链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Windows的右键菜单中设置应用程序的快捷方式.目的是选择一个文档(图像,pdf等)->右键单击->'使用我的应用发送'(并选择打开带有参数的特定类,例如文件路径)

I want to set in the right-click menu of windows, a shortcut to my app. The goal is to select a document (image, pdf etc.) -> right-click -> 'Send with my app' ( and optionnaly open a certain class with arguments, like the files path)

我已经看到了许多实现此目的的可能性...

I've saw some many possibilities to do that ...

但是我想知道使用c#wpf应用程序做到这一点的好方法.

目标是将安装程序发送给许多客户端,以允许他们使用该应用程序,并在上下文菜单中设置条目.

The goal is to send an installation program to many clients to allow them to use the app, and set the entry on the context menu

推荐答案

为了在Windows上下文菜单中显示自定义选项,您将需要更新注册表.这是怎么做

In order to show custom options in Windows context menu, you will need to update the registry. Here is how to do it

http://www.howtogeek.com/107965/how-to-add-any-application-shortcut-to-windows-explorers-context-menu/

完成后,在您的wpf应用程序中,您可以使用以下命令获取传递的命令行参数:

Once done, in your wpf application, you can get the command line arguments passed using :

string[] args = Environment.GetCommandLineArgs();

从这些参数中,您可以提取任何传递的参数(文件位置等)

from these args, you can extract any argument passed (file location etc)

这篇关于c#wpf在Windows的右键单击上下文菜单中设置链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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