I want to add my own custom file extension into the win 7 registry. And I also want to add a right click option "Play with xPlayer" for this extension.
I want to use it in my C# application. How can I do it using the registry?
migrated from stackoverflow.com Feb 9 '11 at 1:08
This question came from our site for professional and enthusiast programmers.
MSDN has extensive documentation on how to work with file extensions in the Registry. Start with these articles:
Update: You would need to create the following Registry keys and values at a bare minimum (file extension registrations support a LOT of features):
HKEY_CURRENT_USER\Software\Classes\.myext (Default) = "MyAppExt" HKEY_CURRENT_USER\Software\Classes\MyAppExt\shell\PlayWithXPlayer (Default) = "Play with xPlayer" HKEY_CURRENT_USER\Software\Classes\MyAppExt\shell\PlayWithXPlayer\command (Default) = ""c:\path to\xplayer.exe" "%1""
When your player app is started, it can look at its command-line parameters, and if it sees a filename passed in, it can play the file as needed.