Article Preview
Buy Now
COLUMN
Notes, Questions, and Answers
Christian tackles a variety of issues
Issue: 3.2 (November/December 2004)
Author: Christian Schmitz
Author Bio: Christian Schmitz is the creator of the Monkeybread Software REALbasic Plugins.
Article Description: No description available.
Article Length (in bytes): 10,070
Starting Page Number: 42
Article Number: 3220
Resource File(s):
3220.zip Updated: 2013-03-11 19:07:58
Related Link(s): None
Excerpt of article text...
More on registering file types
In the last issue you learned how to add your own file type to the Windows registry. In this issue, we'll learn more about where and when to do this.
If your application has an installer, the installer should take care of registering file types by asking which extensions your application is allowed to register and registering them. The installer should also allow the user to un-register these file types.
For example, you can add an entry in the preferences window labeled "File Types" where the user can select, using checkboxes, which extensions should be linked to your application. In the Windows world, several applications may use the same extensions, so it is very important to give the user the option to decide which application handles which extension. You can expect that your application will be uninstalled within seconds after the user sees that it takes an extension away without permission.
A good example of all this is QuickTime. A lot of Windows users did not like previous versions of the QuickTime plugin because it took over the handling of common extensions like ".jpg" or ".avi". Later versions asked the user about this and allowed the installer to limit QuickTime to groups of extensions, like typical Apple extensions (".qt", ".mov", ".aiff"). Today you can select in the QuickTime preferences dialog exactly which extension should be linked to the QuickTime Player and which ones should be left alone.
If you do not use an installer, another option is to ask the user about file types on the first launch of the application. As a default, you can have selected all those file extensions which do not already exist in the registry. So if you ask the user about *.psd (Photoshop picture file) for your great picture viewer application and the user already has Photoshop installed, you should not mark the "*.psd" checkbox. However, if no application is registered for this extension you could offer to register your application as the viewer for Photoshop files.
...End of Excerpt. Please purchase the magazine to read the full article.