在系统的右键菜单中添加选项
2006-05-17 23:28
441 查看
using System;
using Microsoft.Win32;
using System.Diagnostics;
namespace 在系统菜单中添加命令
{
/// <summary>
/// Class1 的摘要说明。
/// </summary>
class Class1
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main(string[] args)
{
//
// TODO: 在此处添加代码以启动应用程序
//
if(args.Length>0)
{
Console.WriteLine(args[0]);
Console.Read();
}
else
{
Process p=Process.GetCurrentProcess();
RegistryKey RegKey;
RegKey=Registry.ClassesRoot;
RegKey=RegKey.CreateSubKey("*//shell//MyApp");
RegKey.SetValue("","What is this?");
RegKey=Registry.ClassesRoot;
RegKey=RegKey.CreateSubKey("*//shell//MyApp//command");
RegKey.SetValue("",p.MainWindowTitle+"%1");
RegKey.Close();
}
}
}
}
using Microsoft.Win32;
using System.Diagnostics;
namespace 在系统菜单中添加命令
{
/// <summary>
/// Class1 的摘要说明。
/// </summary>
class Class1
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main(string[] args)
{
//
// TODO: 在此处添加代码以启动应用程序
//
if(args.Length>0)
{
Console.WriteLine(args[0]);
Console.Read();
}
else
{
Process p=Process.GetCurrentProcess();
RegistryKey RegKey;
RegKey=Registry.ClassesRoot;
RegKey=RegKey.CreateSubKey("*//shell//MyApp");
RegKey.SetValue("","What is this?");
RegKey=Registry.ClassesRoot;
RegKey=RegKey.CreateSubKey("*//shell//MyApp//command");
RegKey.SetValue("",p.MainWindowTitle+"%1");
RegKey.Close();
}
}
}
}
相关文章推荐
- ubuntu系统右键菜单添加【当前路径打开终端】选项
- ubuntu16.04 xfce4的鼠标主题设置为oxygen-red、修改文件夹背景颜色、两处系统字体设置、右键菜单添加压缩解压选项
- 在Windows中添加右键菜单选项及快捷键(转)
- Win10鼠标右键菜单发送到添加子菜单选项的方法
- 在Windows 8/8.1的右键菜单中添加发送到OneDrive选项的方法
- 使用Java添加系统右键菜单
- Windows操作系统下给文件夹右键命令菜单添加启动命令行的选项
- Ubuntu14.04右键菜单添加Sublime 2打开选项
- 添加Dropbox服务到系统右键菜单
- 如何在IE右键菜单中添加选项
- 右键菜单添加UltraEdit的选项(转)
- 添加右键菜单“加密和解密”选项(EFS)
- 添加电源icon的右键菜单选项
- 如何在IE右键菜单中中添加自已的选项
- 如何在GNOME的鼠标右键菜单里添加启动终端的选项
- JCEF 如何修改右键菜单项(JCEF在右键菜单中添加开发者选项-show dev tools)
- 在Windows中添加右键菜单选项及快捷键(转)
- 使用Java添加系统右键菜单
- JCEF 如何修改右键菜单项(JCEF在右键菜单中添加开发者选项-show dev tools)