[ Go to June 1997 Table of Contents ]

Optimizing Windows /
John Woram

Apropos Associations
Get a better handle on launching applications with the right file associations.

Last month I showed how a few new Windows 95 applications handle-or mishandle-file associations during setup. Since there aren't any rules on how to treat existing associations, some people say, "Just leave them alone." Even if there were rules, certain apps would break them anyway. You should just hope for the best, but prepare for whatever is needed to restore your preferences later.

After you've restored order and can again launch your favorite app by double-clicking on a document icon, you may instead want to open the same document in another app. Obviously, you can just open the other app and load the document, but there should be a faster way. Well, there is. You can even set up a simple click/keystroke sequence to do the job.

To demonstrate, I'll keep tweaking the apps used last month. On one system I had installed Microsoft Internet Explorer (IE) as part of a Win95 installation. It associated GIF and JPG files with itself, which was fine for the moment. Later I added HiJaak Pro (HJP) and then redid the associations so that a double-click would open either file in the HJP window instead of in the IE browser. I'd occasionally like to see how either file type will appear in the browser again. I can always do all of the following:

-- Double-click on the Internet icon.

-- Hit the Cancel button when the Sign In dialog box appears.

-- Wait for IE to open and display my default startup page.

-- If a "Cannot open the Internet site" message appears, ignore it and click on OK.

-- Type over the Address line with C:\Windows\Desktop\filename.

JPG. (Rewrite this line to find and open your own desired GIF or JPG file.)

A much faster way would be to highlight the desired file icon, open its Context menu and select the IE option-except for one problem: There is no IE option. Let's add one, again using the JPG/HiJaak Pro combination as an example. Open the Registry Editor window's HKEY_CLASSES_ROOT key, then scroll down to and open the .jpg subkey. In its Contents pane, note the name cited on the (Default) line. Here it's HiJaak.Image. Find the key with this name and open the Shell subkey beneath it. The "open" subkey seen under the Shell key places an option called "open" on the Context menu for any JPG file.

Now, we'll add the Internet Explorer option. Make sure the Shell key remains highlighted, open the Edit menu, select New/Key and type Internet Explorer. A new key with this name now appears under the Shell key. Repeat the same procedure to add a "command" subkey under the new "Internet Explorer" key, then double-click on the small ab icon next to (Default) in the Contents pane. Enter the appropriate command line in the Value data box, which in this case is:

"C:\Program Files\Microsoft

Internet\iexplore.exe" %

Or you can enter:

C:\PROGRA~1\MICROS~x\iexplore.exe %

You need the quotes in the first example because of spaces in the pathname. In most cases the x in MICROS~x is a "1." It could be higher though, if you have more than one subfolder under Program Files with a name that begins with "Microsoft."

If so, open a DOS box and do a directory listing of all subdirectories under the C:\Program Files directory. Find the one whose long filename is Microsoft Internet, note the number that appears at the end of its 8.3 name, and if necessary use it instead of "1" in the line above. The name of the selected file automatically replaces the "%1" parameter at the end of each line when the command line is executed. Now the Context menu will show a new Internet Explorer option. Click on it, and the selected file opens in IE.

Line 'em up

When you add a new option such as this to a Context menu, the first letter of its name is underlined on the menu. The option executes if you press that letter key, unless the same letter is underlined in other menu options. In that case, the highlight toggles between options each time you press the letter key, and you must press the Enter key to initiate the selected option.

For example, in this case the menu shows Internet Explorer and HiJaak Print. To eliminate the toggle step, select a letter in "Internet Explorer" that is not already underlined in the other Context menu options-the "x" in Explorer, for example. To underline that letter, open the newly created Internet Explorer key, double-click on its (Default) icon and type Internet E&xplorer in the Value data box. The "&" signifies that the next letter gets the underline instead of the "I" in Internet. If you like, make the first letter of Explorer a lowercase "e" and follow it with an uppercase "X" as a visual aid in spotting the new underlined letter in the option.

You might want to further simplify things-especially if you repeat this operation for more than one file type. Instead of underlining a unique letter within each new option name, simply rewrite the name to display an underscored period at the end, as shown here:

Internet Explorer&

If you follow this convention every time you add a new executable application to a Context menu, then you can launch every such app with the identical two-step operation: With the mouse pointer over the desired icon, click the secondary mouse button. Then press the period key.

From now on, launch any secondary app with this simple click/press sequence. It's almost as fast as a double click; moreover, you don't have to study the Context menu to locate the name and menu position of the alternate application.

When more than one option exists at the top of the Context menu, you can resequence them so that the new secondary app name appears in position 2 in the list. Just note the name of any option that appears above it on the menu, open the appropriate Registry key, export and delete it. Repeat this procedure as necessary until the new option occupies position 2 on the menu. Then import each recently deleted key back into the Registry.

Since every such new option appears below the previous option on the list, the Internet Explorer option used in this example retains its number 2 position. This is strictly a cosmetic configuration, as the physical position of an option on the Context menu has no effect on system performance. The default action, which is usually "Open," always occupies position 1 on the list.

You can maintain a record of custom subkeys added to the Registry. Highlight the new key and add a Remark subkey beneath it, then double-click on the (Default) icon and type a short note to yourself in the Value data box. Later, you can search for Remark subkeys to remind yourself of the changes you've made and why.

If you'd rather not meddle with the Registry, you can do some of the above from within IE. Go into View/Options/File Types and highlight HiJaak.Image in the list of Registered file types. Click on the Edit button to open the Edit File Type dialog box, then click on the New button and type the following data in the New Action boxes:

Action: Internet Explorer&

Application used ... : "C:\Program Files\MicrosoftInternet/iexplore.exe"

Click on OK and then the Close button twice to exit. The procedure writes a new structure with a subkey name (Internet_Explorer.) slightly different from the one I used above (Internet Explorer). Naturally, the underline between words and trailing period in the key name have no effect other than to confuse you. On the Context menu, the underline does not appear between the words, but does appear under the period at the end. If you want to add the Remark key, you will have to edit the Registry-you can't do that from IE.

A quick view of Quick View

Speaking of secondary apps, the Win95 Quick View applet does just what its name suggests. If you find this option on a Context menu, use it to quickly open the selected document file in a Quick View window. There you can view but not edit the file. To verify that you have Quick View, open IE's View menu, select Options/File Types. Then highlight any registered file type, click on the Edit button and note the status of the Enable Quick View check box near the bottom of the Edit File Type dialog box. If the check box and text near the bottom of the Edit File Type dialog box are disabled, then Quick View is not installed. If that's the case, open Control Panel's Add/Remove Programs applet, select the Windows Setup tab, highlight Accessories and click on the Details button. Drill down through the Components list, put a check mark next to Quick View, click on OK twice. Insert the Win95 CD-ROM in the drive and again click on the OK button to complete the Quick View installation.

As part of the installation procedure, the Appletpp.inf file (as in, Applet-PlusPack file) in the C:\Windows\Inf folder adds a collection of filename extension subkeys under the Registry's HKCR\QuickView key. Each such key leads in turn to a subkey whose name ({F0F08375...}) is the CLSID key associated with the SCC (Systems Compatibility Corp.) Quick Viewer applet. The applet is also supported by a collection of DLL files in the C:\Windows\System\Viewers folder (also the location of the executable file-QUIKVIEW.EXE)

Here's a potential source of confusion: Now that the Enable Quick View line is activated, you can simply put a check mark in the box next to it. You might assume that would actually enable Quick View for that file type, but it might not. You can find out the hard way, or else have a look at the Registry's HKCR\QuickView subkey structure before putting in the check mark. These subkeys serve as Quick View's own quick view of the file types it currently supports, and you'll note there is no .GIF subkey in the list. The current version of Quick View does not support this file format, although a check mark next to the GIF Image file type will place the Quick View option on any GIF file's Context menu. Select that option and you'll get a message that says, "There is no viewer capable of viewing GIF image files."

I suspect Quick View's GIF image support was not quite ready at the release of Win95. Although Appletpp.inf includes lines to write APS, GIF, REG and TIF subkeys, these have been disabled by semicolons at the head of each line. Although I could enable support for APS and REG file types by removing the semicolons and reinstalling Quick View, that won't work for GIF and TIF files. These require support from VSGIF.DLL and VSTILL.DLL files-both cited but disabled in the INF file, and nonexistent on the CD-ROM.

Try Quick View Plus 4.0 to view GIF files. This $59 super set of the version described above comes from Inso Corp. (formerly SCC), and adds support for GIF, TIF and just about every other file type you encounter, including Zip files.

I'll refer to the two Quick Views as QV and QV+ for the rest of this discussion. To save a bit of hard disk real estate, uninstall QV first, which removes its DLL files (no longer needed) from the C:\Windows\System\Viewer folder and deletes its CLSID key. You can also delete the Registry's old Quick View key structure, which won't be needed. If you leave it in place, QV+ renames it as QuickView.Original, then writes a new Quick View key. It also writes new DLL files (about 120 of them) into its own PROGRAM folder and adds a new CLSID key in the Registry.

Unlike its predecessor, QV+ will display an OLE object embedded within another file format. For example, QV displays a bitmap embedded in a Word document as a shaded area with a Graphic Object label in it. By contrast, QV+ displays the actual bitmap as it appears within the document. Double-click on any document text to open the file in Word, or double-click within the image area to load the bitmap into the Windows Paint applet.

Better error handling

QV+ also improves its handling of error messages. In QV, you might get an uninformative or misleading error message if the option is selected and the DLL file(s) required to view the selected file type are missing or damaged. A typical message might read: "Could not view filename.ext, the viewer returned an unknown error" or "There is not enough memory to view or print filename.ext. Quit one or more files or programs, and then try again."

Neither message hints that the real problem may be a missing DLL file, and the second message may not be valid. To quickly check available memory, try to open the file in its associated app. If that fails, then there is indeed a memory problem. Otherwise, it's probably a missing or defective DLL file: Uninstall QV and reinstall it.

In QV+, a missing DLL file may generate one of the following messages, which are a bit more informative than the examples above: "View window could not access the DLLs it needed to view the file" or "This installation of Quick View Plus does not currently support viewing files of this type."

Senior contributing editor John Woram is the author of The Windows 95 Registry: A Survival Guide for Users (MIS: Press, 1996). Contact John in the "Optimizing Windows" topic of the WINDOWS Magazine areas on America Online and CompuServe, or at the e-mail addresses here.

Windows Magazine, June 1997, page 256.

[ Go to June 1997 Table of Contents ]