first time posting in StackOverflow. :D I need my software to add a couple of things in the registry.
My program will use
Process.Star
If you are planning on providing an installer for your application, simply use the file association feature available in whatever installer framework you choose to use - even the Visual Studio setup project knows how to do this.
To alter file type associations directly from your code, I believe you have to look into HKEY_CLASSES_ROOT
and find/create a key with the extension you want to bind to (ie ".pdf"). Within this key, the default value is a string containing a reference to another key within HKEY_CLASSES_ROOT
. Go follow that pointer, expand/create the shell
subkey and add/change your commands here. Look around this area with regedit
to get the fealing of how it looks.
I have some C# code in a pet project of mine, which looks up the binding for PDF files and adds an extra option to their context menus. Feel free to have a look.