Hi,
I still find it a bit complicated, but with the help of the guys who created the free install program Inno Setup, I was able to figure it out for my app. See a summary of the steps below:
In HKEY_CLASSES_ROOT:
Create a key for the file extension (e.g. .abc) Type is REG_SZ, name is default, value is the internal name for your app. Note that this should be unique to avoid overwriting an existing app's values. E.g. MyApp.SpecialFile
Create a key for your app using the unique name from above (e.g. MyApp.SpecialFile). Type is REG_SZ, default name, value is the file type description you want to see in Explorer (e.g. My Application Special File)
In that key, create a subkey DefaultIcon. Type is REG_SZ, default name, value is the full path to your app, followed by a comma and a number. (E.g. "C:\Program Files\MyApp\MyApp.exe,0")
"DefaultIcon" is the registry key that specifies the filename containing the icon to associate with the file type. ",0" tells Explorer to use the first icon from MyApp.exe. (",1" would mean the second icon, etc.)
At the same level as the DefaultIcon key, create another key called shell. In that key, create a subkey open, and in that key, create a subkey command.
The type for all three keys is REG_SZ and the name for them is the default value. The value is blank for all but the command key. There you use the command-line way to open your app with the selected file. (E.g. "C:\Program Files\MyApp\MyApp.exe" "%1")
Hope this helps,
Erwin
PS. Note that this assumes that you have created your app to accept a parameter during startup !
Enter your message below
Sign in or Join us (it's free).