I'm trying to implement an option in the context menu of Windows Explorer for any file and any folder. I have accomplish this by writing into regedit.
Using Microsoft.Win32;
...
RegistryKey key;
// Register to any file
key = Registry.LocalMachine.CreateSubKey(@"SOFTWARE\CLASSES\*\shell\MyProject");
key = Registry.LocalMachine.CreateSubKey(@"SOFTWARE\CLASSES\*\shell\MyProject\command");
// Register to folder
key = Registry.LocalMachine.CreateSubKey(@"SOFTWARE\CLASSES\Folder\shell\MyProject");
key = Registry.LocalMachine.CreateSubKey(@"SOFTWARE\CLASSES\Folder\shell\MyProject\command");
// Default value points to the app
key.SetValue("", Application.StartupPath + @"\MyProject.exe");
key.Close();
The application opens as I want, however I have no clue how to grab the path of file/folder that was selected in the context menu. How can I do this?