| Printable Version
Very Simple Shell Ext
By Michelangelo Giacomelli
How to add a "open with my prog" voice in context menu. ("shell menu ext"), this feature is usefull when we make same program and we want register same extension to it.
// project created on 24/08/2002 at 22.05
using System;
using Microsoft.Win32;
class AddShellCommand
{
public static void Main(string[] args)
{
RegistryKey newkey;
newkey = Registry.ClassesRoot.CreateSubKey("myprog_file");
newkey = newkey.CreateSubKey("shell");
newkey = newkey.CreateSubKey("Open with myprog");
newkey = newkey.CreateSubKey("command");
newkey.SetValue ("", "c:\myfolder\myprog.exe %1");
newkey = Registry.ClassesRoot.CreateSubKey(".myext");
newkey.SetValue ("", "myprog_file");
}
}
|