WFApMenu © 1992-1993 by David Foster CIS: 76436,3627 To read this file in Notepad, turn on Word Wrap in the Edit Menu. You may also want to maximize the Notepad window. WFApMenu is a File Manager Extension that adds an applications menu to the Windows File Manager. This can be used to launch programs from the File Manager without first moving to the correct directory. Also, you can load a selected file into the application chosen from the menu. For instance, imagine you're looking at a file named README.1ST in the File Manager. To read this file, you must either find Notepad in another File Manager window and drag README.1st to the Notepad application; or open Notepad from File->Run or the Program Manager, choose open, then find the README.1ST file. With WFApMenu, you would simply click once on the README file, then hold down the shift key and choose Notepad from the Application menu. WFApMenu will load the README.1ST file into Notepad, regardless of the Extensions settings in WIN.INI WFApMenu is Shareware; if you find it useful, please send $10 (US) to: David Foster 184 Eckford St. #3 Brooklyn, NY 11222 Any distribution of this program should include this Readme file. If you do not register within the evaluation period (30 days), then you must deinstall WFApMenu and remove it from your disk. DE-INSTALLING If you choose not to register WFApMenu, you may completely DeInstall WFApMenu by deleting the line that begins WFApMenu= from the WINFILE.INI file (you'll find WINFILE.INI in the windows directory). Also delete WFApMenu.INI from the same directory. The only other file to remove is WFAPMENU.DLL itself. INSTALLATION This section covers how to install WFApMenu. If you already know how to install a File Manager Extension, you can simply add the line WFApMenu=\WFAPMENU.DLL to WINFILE.INI and go to the next section (ADDING PROGRAM ITEMS). Installing WFApMenu is simple. First, decide where you are going to store WFApMenu.DLL. You can put it in the windows directory, or any other place on your disk that you like. The following discussion assumes that WFApMenu.DLL is in the C:\WINDOWS directory. You will need to edit the WINFILE.INI file, which is where settings for the File Manager are stored. You may want to backup the original under another name before proceeding. Open the Winfile.ini file in a text editor. The Notepad applet that comes with Windows is perfect for this, you can also use the Dos Edit program or any other text editor. If you use a full-fledged word processor, be sure to save the file as Text Only! Assuming you are using Notepad, open the WINFILE.INI file. You'll find it in whatever directory WINDOWS is in, probably C:\WINDOWS. Look for a line that reads: [AddOns] If the line is not there, go to the end of the file and on a blank line type [AddOns] (with the brackets). If you've already installed other Extensions (DOS 6 automatically adds one) then after this line there will be a number of listings such as this: Something=C:\WINDOWS\PROGRAM.DLL SomeThingElse=C:\SOMTHING.DLL On the first blank line after the [AddOns] line, but BEFORE the next line that starts with the '[' character (you can hit ENTER to add a new line if you need to), Enter the line WFApMenu=C:\WINDOWS\WFApMenu.DLL Here you would put whatever the full pathname to WFApMenu.DLL is. For instance, if you would like to keep WFApMenu.DLL in the E:\UTILS directory, then you would enter: WFApMenu=E:\UTILS\WFApMenu.DLL Save your changes to the Winfile.ini and exit Notepad. Again, if you are using a full word processor, be sure to save the file as text only!!! That's it. The next time you run the File Manager, there should be a menu named Apps. The name of this menu can be changed if you would like (see WFAPMENU.INI below). ADDING PROGRAM ITEMS To add items to the menu, choose Edit Items. From the dialog box that appears, choose the New button. There are two parts to any application item. First, the menu name refers to the name you would like to see in the menu. The command line is the actual command needed to run the program. For instance, for Word for Windows, the command line might read C:\WINWORD\WINWORD.EXE /n As you can see, you can add switches to the command line if you'd like. Also, while full pathnames are not required if the program is on the DOS Path, I strongly recommend using the full pathname. WFApMenu uses the pathname to set current directory for the program. The menu item, however, can be anything you'd like. To underline a letter (so that you can choose the item from the menu by typing that letter) place an ampersand (&) before the letter you want underlined. For instance, a menu name of MS &Word would include MS Word (with the 'W' underlined) in the Application menu. If you click the browse button, you will see a standard dialog box that you can use to choose new items for the WFApMenu menu. Find the application that you would like to add to the menu, then click OK. WFApMenu will provide a sample Menu Name and Command Line, which you can then edit. I suggest editing the Menu Name (put the '&' whereever you would like an underline, change to lower case, or whatever). WFApMenu's suggestion for the menu name will generally be pretty ugly. The command line shouldn't be changed unless you would like to add switches to the command. If you decide that you would like to change a command line for a menu item, you can choose the item from the list box, change the command line, then click on the SET button. Please remember, the command line will not be changed unless you click on the SET button. If you wish to change the name of a Menu item, then you must edit the WFAPMENU.INI file directly. See below under WFAPMENU.INI. The Delete button deletes the menu item that is currently selected in the list box (obviously). LOADING FILES To load a file into an application, select the file in a File Manager window, then while holding down the SHIFT key, choose an application from the WFApMenu menu. WFApMenu will load the application with the name of the current file selected. WFApmenu will use ONLY the first file selected in the window. If you have more than one file selected, only the name of the first one will be handed off to the application. WFApMenu does this by simply appending the name of the file selected to the current Command Line associated with the application (including switches). This works for most programs, however, there are some problems you may want to be aware of. First, there are a few programs I have found (usually small shareware utilities) that will not launch a file from the command line. You will not be able to use WFApMenu to load files with these programs. Many programs will also not work correctly if they are already running when you try to launch them again with a new file. If there are any switches (such as /n or /ad) in the command line, the filename is added after the switches. Also, a few programs (such as Windows Notepad) expect a default extension. If you choose a file with no extension, the program will add the default extension, thus creating a different filename. For instance, if you try to load a file named README into Notepad, Notepad will try to open README.TXT, which may or may not exist, but is not the file you asked for. If you try to open a file with an application that can't read that type of file, the result depends on the application. Usually, you will simply receive an error dialog box. WFAPMENU.INI When you first run WFApMenu.DLL, it will create a file called WFAPMENU.INI in the Windows directory. This is where settings for the program are stored. There are two sections to this file, [Options] and [Apps]. The meaning of the entries is thus: Various setting are kept in the [Options] sections: MenuName=&Apps This is the name of the menu for WFApMenu. If you wish the name to be something other than Apps, simply change this entry. Remember, place an ampersand (&) before the character you would like underlined in the Menu Name. For instance, if you prefer the menu to be name Programs (with the 'g' underlined), this line would read MenuName=Pro&grams EnableLoad=1 If you would like to disable the ability to load the selected file with the shift key, change the 1 to a 0 (that's a zero). WFApMenu then becomes a simple application launcher. NoEditItems=0 If you would like to remove the "Edit Items" menu item, change the 0 to a 1. This can be useful if you are setting up this extension for other users, and do not wish them to change the applications listed in the menu. The setting for the applications that appear in the menu, are kept in the [Apps] section. The entries read = for example, an entry for Notepad might read &Notepad=C:\WINDOWS\NOTEPAD.EXE Switches are included on this line. The entries for MenuName and Command Lines are identical to the entries in the Edit Items dialog box. Read ADDING PROGRAM ITEMS above for more information. ADDENDA If there are switches on the command line and you try to shift-launch a file, the filename is added to the command line after the switches. This is correct for most programs. If you need the filename before the switches, you'll need to launch a batch file for the application (assuming it's a DOS rather than WINDOWS application). Anything added in the Optional Parameters section of a PIF file will override the command line set by WFApMenu. That's just the way WINDOWS works. If you are having problems launching files into a specific DOS application, that's probably the first place to look. Current directory tends to be a problem with the File Manager. When you launch an application from WFApMenu, the current directory for that application will be set to the directory listed on the command line if a full pathname is given for the program. Otherwise current directory will not be changed. This can cause problems if File Manager has set current directory to a floppy drive. This is why I suggest always including a full pathname for each application in the WFApMenu menu. If, however, you use the shift key to open a file, current directory is set to the directory that file is located in. This may cause a problem with some older applications, but it makes usage much better for many other utilities (for instance, for compression utilities or text replacement utilities, current directory should always be the location of the file rather than location of the application). If you would like to change WFAPMenu.INI on the fly, choosing the Edit Items command will force WFApMenu to re-read its INI file. This will only work for application items only, however. The options settings are set when File Manager is first launched. VARIOUS TIPS You can add various switches to many programs to achieve some useful results with WFApMenu. Here are a few of the things I do. Add a items such as this to print text files. Print &Text=c:\windows\notepad.exe /p With the /p switch, Notepad will print the file. You can then select any text file in File Manager (regardless of extension) and print it by holding down the shift key and choosing this item. To view the contents of zip files (if you don't have a windows zip viewer), create a pif file called called (for instance) ViewZip.PIF. List PKZip as the program filename, and uncheck the box for Close Windows on Exit. Next add a menu item to WFApMenu such as this: &View Zip=c:\pifs\viewzip.pif /v Now when you choose a zip file and choose this item, you will open a windows that lists the contents of the file without decompressing it. The Control panel can be set to open a specific window if you add the name of the module. For instance: P&rint Setup=C:\WINDOWS\CONTROL.EXE PRINTERS will open the Printer Setup window of the control panel If you add an item for the dos prompt, I suggest using DOSPRMPT.PIF for the command line rather than Command.com. For instance, &Dos=c:\windows\dosprmpt.pif LEGAL STUFF Notepad, Windows, DOS, Winfile, File Manager, Winword and Word for Windows are all registered trademarks of Microsoft Corporation. (What isn't?) PKZip is a registered trademark of PKWARE, Inc.