Very Simple Shell Ext


How to add a "open with my prog" voice incontext menu. ("shell menu ext"), this feature is usefull when we makesame program and we want register same extension to it.

<center></center>

 

// 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");
}
}

Twitter Digg Delicious Stumbleupon Technorati Facebook Email

No comments yet... Be the first to leave a reply!