BuildPC * CustomizeWindows * InstallOS * Internet * HardwareProblems * E-Mail * Home
PCWorkz


Managing File Associations


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:

  1. In the Explorer, choose View, Folder Options.
  2. Click the File Types tab of the Options dialog box.
  3. Choose the New Type button.
  4. Enter a description of the file type in the Description of Type text box.
    This description appears in the Registered File Types list on the File Types page of the Options dialog box. For example, if you want to be able to use Microsoft Word to open WordPerfect files that use the extension WPD, you could use the description WordPerfect Documents.
  5. Enter the file extension to be associated with this file type in the Associated Extension text box. This is the three-letter file extension associated with DOS-based files. In this example, you would enter WPD.
  6. Select the type of file from the Content Type (MIME) list. This list shows all the installed applications in the registry.
  7. If you want to specify an action to be performed on this file type by its associated program or if you want to add a shortcut menu item for this file type, then skip step 8 and continue with the next procedure to specify an action.
  8. Click OK twice.

Note
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:

  1. Click New to add a new action to the file type in the New Action dialog box.
    The action is actually a custom command that appears on the shortcut menu when you right-click the file.
  2. Type an action, for example, Open in Word, in the Actions text box.
    What you type will appear as an item on the shortcut menu for this file type. You can type anything, but commands usually start with a verb. If you want the command to have an accelerator key, precede that letter with an ampersand (&).
  3. Enter or select the application to be used to perform the action in the Application Used to Perform Action text box. If you do not know the application's path, use the Browse button to select the application.
    Some applications have command-line switches you can append to the end of the command line to control how the application behaves. See the documentation or online Help for your application to find out what command-line switches are available.
  4. Select the Use DDE check box if the program uses DDE (dynamic data exchange) and add the DDE statements for this action. This is rarely used.
  5. Choose OK.
  6. If you have more than one action listed in the Actions box, select the one you want to be the default action and choose the Set Default button.
    The default action is the one that is performed when you choose a file of this type in the Explorer or a folder window.
  7. Select the appropriate check boxes for the file type.
    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
  8. Choose Close twice.

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:

  1. In the Explorer, choose View | Folder Options.
  2. Choose the File Types tab to display the File Types page of the Options dialog box.
  3. Select the file type or other object whose icon you want to change in the Registered File Types list.
  4. Choose the Edit button.
  5. Choose the Change Icon button to display the Change Icon dialog box.
  6. Select a new icon from the Current Icon scrolling list. The name of the file containing the icons currently shown is listed in the File Name text box. You can use the Browse button to search for a new file containing different icons.
  7. Choose OK and then Close two times.