Skip to content

Instantly share code, notes, and snippets.

@follesoe
Created December 24, 2010 14:37
Show Gist options
  • Save follesoe/754293 to your computer and use it in GitHub Desktop.
Save follesoe/754293 to your computer and use it in GitHub Desktop.
Using protocol handlers as a ultra thin layer of integration
RegistryKey helpDesk = Registry.ClassesRoot.CreateSubKey("HelpDesk");
helpDesk.SetValue("", "URL:HelpDesk Protocol");
helpDesk.SetValue("URL Protocol", "");
RegistryKey defaultIcon = helpDesk.CreateSubKey("DefaultIcon");
defaultIcon.SetValue("", Path.GetFileName(Application.ExecutablePath));
RegistryKey shell = helpDesk.CreateSubKey("shell");
RegistryKey open = shell.CreateSubKey("open");
RegistryKey command = open.CreateSubKey("command");
command.SetValue("", Application.ExecutablePath + " %1");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment