To make this right-click-open-with-approach work, you need to process command-line parameters to your program. If it has been called by the operating system with the intent to open a file, the OS will
1. have called your executable and
2. have appended the path to the file as parameter.
Use the Environment.GetCommandLineArgs()
] method to get all the arguments that your executable has been called with and check if the first one is a file that you can open. If so, then open it just like you would do after user clicks File - Open - [filename] from within your application.