添加物品到右键菜单 [英] Add item to right click menu

查看:130
本文介绍了添加物品到右键菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将项目添加到右键菜单(如TortoiseSVN做的,或者7zip的等...)

I'd like to add an item into the right click menu (like TortoiseSVN does, or 7zip etc...)

我不知道如何做到这一点,或它是什么特别要求。

I'm not sure how to do this or what it is specifically called.

这将是preferable如果在我的程序运行此选项是唯一可用的。

It would be preferable if this option was only available while my program was running.

使用情况:

用户将选择在网页上(他们的计算机上或Word文档或任何东西)一些文本,点击右键,从菜单中选择我的项目,我分DoSomething的(字符串MyString的)会跑。

User would select some text on a webpage (or word document or anything on their computer) and right click, select my item from menu and my sub DoSomething(string myString) would run.

编辑:

我目前正在开发的XP,但我想这个节目的工作在Vista / Win7的

I'm currently developing on XP, but I'd like this program to work on Vista/Win7

推荐答案

这要看你想上哪儿上下文菜单项目和什么总体目标。大部分的答案至今是在资源管理器右键菜单,但如果你想改变一个程序作为你的问题国家内部的上下文菜单,它变得更加困难和/或不可能的。

It depends on where you want the context menu items and for what overall purpose. Most of the answers so far are for context menus in Explorer, but if you want to change a context menu inside of a program as your question states, it becomes much harder and/or impossible.

但是,它很可能添加上下文菜单项到文件的浏览器类型,而外壳扩展,它可以通过的注册表操作第三方公用事业的,或与COM作为其他人说。

However, it's very possible to add context menu items to file types in explorer without shell extensions, it's possible by registry manipulation or 3rd party utilities, or with COM as others have said.

这篇关于添加物品到右键菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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