Recall that in Windows 3.x, you can associate a file extension with an application. For example, you can associate the DOC extension that Microsoft Word adds to files to Word, so that when you choose a file with the DOC extension, the file is opened in Word.
In Windows 98, you can define a file type, associated with a file extension, and then associate any number of actions with the file type. Again, using Word as an example, you can define the Microsoft Word Document file type, and then define one or more actions associated with that file type. The default action can be executed by choosing a file with the DOC extension in Windows Explorer or in a folder window or by right-clicking a DOC file and choosing the default action from the top of the shortcut menu that appears.
Other actions that you define and associate with a file type will appear in the shortcut menu when you right-click a file of that type. When Microsoft Word for Windows is installed, for example, the Print command is automatically associated with the Word Document file type, so you can right-click a Word file and choose Print from the shortcut menu. The document will be opened in Word, printed, and then closed.
How applications register file types
All file types and their actions are registered in the HKEY_CLASSES_ROOT key of the Windows Registry. If you are experienced in working in the Registry using REGEDIT, you can add and edit file types directly in the Registry.
Registering a New File Type
Many applications automatically register a file type when you install the application. In some cases, however, you may want to register a file type for an extension that is not already associated with an application.
To register a new file type, follow these steps:
MIME (Multipurpose Internet Mail Extensions) is a standard for defining different types of file attachments for e-mail delivered over the Internet. The goal of MIME is to allow multiple types of data, such text, video and audio files, and application files, to be gathered together in an e-mail message and transferred successfully from sender to recipient, even if they are using different e-mail applications.
You can specify the type of action which occurs on a file type when the file is chosen. The action you specify will also appear as an item on the file type's shortcut menu and on the File menu when that file is selected. This procedure begins with either the Add New File Type or Edit File Type dialog box open. To create actions for a new file type, follow the previous procedure through step 7, then continue here. To edit an existing file type, select the file type from the Registered File Types list and click Edit.
To simultaneously specify actions for the file type and create shortcut menu items, follow this procedure:
|Enable Quick View||Quick View allows you to view a file without opening it|
|Always Show Extension||Always displays the MS-DOS extension even when the Hide File Extension option has been chosen.|
|Confirm Open After Download||Request confirmation before opening files after downloading them from the Internet|
Understanding DDE settings
If the application you use to create a file type and define an action uses DDE (Dynamic Data Exchange), you can use DDE statements to exercise more control over the actions carried out by the application. DDE statements are messages that are passed to the application to tell it what actions to carry out.
Changing the Icon for a File Type or Other Object
You can change the icon used to designate a file type, drive, folder, and other objects on your computer. To change the icon used for a particular file type or object, follow these steps: