No matter how long you've used Windows, you probably still use at least one DOS application, if only occasionally. The older a DOS program is, the more problems you are likely to experience when you run it in a Windows environment. Creating or altering a program information file (PIF) specifically for individual DOS applications can resolve many of those problems. PIFs are used only for non-Windows applications running in Windows. DOS applications typically are memory hogs, often requiring at least 640 kilobytes (KB) to run. They also may need expanded or extended memory to perform well, and, unlike Windows applications, don't reallocate that memory when idle. As a result, if you run several DOS applications simultaneously in Windows, you are setting yourself up for a program crash—or at least slow-running applications. (This also can happen when running DOS and Windows programs together, but it is less likely.) Adding or editing a PIF lets you fine-tune DOS applications so they can share system resources but act as if they have the entire PC to themselves, with direct access to random-access memory (RAM), communications (COM) ports, monitor, printer, and any other resources they need. The PIF tells Windows the program's name, type of video used, memory requirements, port accessed, video memory needed, and other information. With old DOS applications, you will have to add a PIF. Newer applications—roughly those made in 1992 or later—are likely to come with a PIF. This file usually is stored in the same directory as the application, with the application name followed by .PIF. Additionally, Windows 3.1 and Windows for Workgroups 3.11 (WFW) come with a Default.pif file that Windows uses if an application doesn't have its own. This file should work smoothly for nearly all applications, with the exception of applications needing expanded memory. Nevertheless, you still may need to edit the PIF for optimal performance. Terminate-and-stay-resident programs (TSRs) usually will run smoothly in Windows' DOS Shell or in DOS alone. (TSRs, often used in DOS, are loaded into memory and pop up when hotkeys are pressed.) If the TSR's hotkeys conflict with keys used by Windows or Windows applications, create a PIF file for it, changing its hotkeys with the Reserve Shortcut Keys option in either Standard or 386-Enhanced Mode, as explained later in this article. If you have an application that needs a batch file to run, include a PIF for the batch file itself. Windows will look for a PIF that uses the batch file's name. Even if you create a PIF for an application that must be launched from a batch file, Windows won't recognize it; make sure you use the batch file's name with the .PIF extension. Use the same settings you would for the application itself. If the batch file runs multiple applications, make the parameters for the batch file as broad as possible.
Finding PIFs. Determining whether your DOS application comes with its own PIF is simply a matter of checking its directory and looking for *.PIF. (an application name will be used in place of the * wildcard.) If the PIF isn't there, check the application's manual. Not all DOS applications that include PIFs copy them to the hard drive during installation, so you may need to load some PIFs separately. You can do this with the Windows File Manager by copying the PIF from the diskette to the application's directory. After copying the file, add the PIF to a Program Manager group so that when you double-click the icon to launch the application, the PIF will be located and used.
Editing & Creating. From Program Manager, choose File, then Open to load the PIF. Make any changes and save them with the SAVE command. Several PIFs can be made for one application by saving them under different names. To change the default PIF settings that Windows assigns to non-Windows files, open the Main program group, and click on the PIF Editor icon. The default settings will appear. Name the file Default.pif. Leave the Window Title box blank, and type any program name in the Program Filename box. The program name is irrelevant here, except that the PIF Editor needs a name there before it will save the file. Changing these settings will not affect the default settings used for any new PIFs you may create later. Open the Main program group again, and double-click the PIF Editor icon. From there, select Mode and then the operations mode—either Standard or 386-Enhanced—for this program. (For more information, see "Choosing The Operating Mode For You" in this issue.) Select the settings for each of the dialog boxes. When you select Mode, the default settings for the mode in which you are currently running will appear in the dialog boxes. As an option to the default settings, check the application's operations requirements in its manual. When you are finished, save the file with the same name as the application but with the .PIF extension. If you alternately run your PC in Standard and 386-Enhanced mode, create a PIF for each operating mode for a given application. Windows will automatically use the settings that match its mode. The DOS application can run smoothly, regardless of the PC's current operating mode.
Using Dialog Boxes. The dialog boxes for Standard and 386-Enhanced modes are slightly different. Each operating mode, however, requests the same basic information and asks for parameters that apply only to that mode. The Program Filename is the name of the application for which the PIF is being created, as well as the complete path and the filename extension. An example is C:\WP\Wp.exe, although the extension also may be .COM or .BAT, depending on the application. The PIF Editor dialog boxes for Standard mode, top, and 386-Enhanced mode, above, are slightly different. | The Window Title is the name used for the title bar of the window when it's running in 386-Enhanced mode. This is optional, so you can do something quirky such as retitling Lotus' Symphony as Beethoven's 5th. If you leave the title blank, Windows will use the program's name. The Optional Parameters box lets you enter any parameters for the application. For example, you might want a program to automatically load a particular file; in an accounting program, loading this year's income statement makes sense. Whatever parameters you load should be entered as if this were the DOS command line, including any slashes. Commands can be up to 62 characters long. Windows will insert one space between the command and the parameter. By entering only a question mark in this space, you will be prompted for the parameters each time you run the PIF. The Startup Directory box lets you list the default drive and directory for this application, after it has started. The safest approach is to list the drive and directory where the application is stored—normally C: if you run from a hard drive, or A: or B: if you run the application from diskette—because it ensures that support files are available. The Video Mode dialog box offers two options presented in slightly different language depending on the Windows operating mode selected: Text or Text and Graphics. The distinction is important, because this setting tells Windows how much memory to allocate to store the program screen when you switch to another window. Proper allocation lets Windows restore the screen quickly when you return to that window. Choose the text mode for programs that use only text; although an application uses boxes or lines on-screen, it may still be text-based, using IBM text characters to generate the graphics. Text uses less memory than Text and Graphics. If you choose the former for a program that uses the latter, the application will lock up, and you will be forced to terminate the program. Some programs, including Microsoft Word in graphic mode, use graphics to display text attributes such as italics. These programs typically use more than one page of video memory to store one page of text. If in doubt about what your particular application uses, check your application manual. If you're still uncertain, choose Text and Graphics. In the Memory Requirements box, list the minimum number of kilobytes the program needs to run properly (see the application's documentation). Windows compares this number with the space actually available when you launch the application to determine whether it has sufficient space to run. This is just the space needed for the application and does not include the space needed for DOS, device drivers, and buffers. Any extra memory will be given to the application. XMS Memory refers to extended memory, which few programs use. Once again, check your application's documentation. Unless the manual mentions extended memory, you can leave KB Required and KB Limit set at zero. Each of the above settings appears in both Standard and 386-Enhanced mode. Both modes also request additional, mode-specific information.
Standard Mode. In Standard mode, the next dialog box is called Directly Modifies. This refers to whether the application itself controls the hardware—specifically the COM ports and the keyboard—or whether it lets the operating system control the hardware. If your application uses a COM port, check the appropriate port. Do the same for the keyboard if the application controls it rather than letting the BIOS and operating system exert control. (The basic input/output system controls communication between the PC and its hardware components.) If your application controls the keyboard, you will be unable to move between the application and Windows without exit ing the application. The advantage is that Windows, in this case, allocates additional memory to the program. Checking the No Screen Exchange dialog box prevents you from copying all or part of the screen to the Clipboard with the PRTSCR and ALT-PRTSCR keys. If you don't plan to copy a screen, checking the option will save memory. Similarly, checking the Prevent Program Switch in the next dialog box prevents you from switching out of the non-Windows application and to another window without exiting the program. This also increases the available memory by freeing the RAM that otherwise would be used to store the screen in the application you left. When the Close Window on Exit box is checked, you can quickly return to Windows after exiting the non-Windows program. Otherwise, you would have to strike a key to return. The No Save Screen box should be checked if the non-Windows application can redraw its own screen when you switch between Windows and DOS applications. Reserve Shortcut Keys lets you specify the ALT- and CTRL-key combinations your application uses to avoid a conflict with Windows when those keys are pressed. Check these boxes only if your application relies on these key combinations.
386-Enhanced Mode. The Video Memory dialog box under 386-Enhanced mode determines the amount of system memory Windows allocates to save the application's screen image when you switch to another application's window. Text mode allocates about 16KB, Low Graphics allocates about 32KB, and High Graphics allocates about 128KB of memory. Selecting insufficient memory will cause the screen either to go blank or only partially restore when you return to this application. Choosing too much memory is wasteful. If, however, you have a VGA or EGA screen, you probably should use the High Graphics option. If you want to save RAM for use elsewhere, you can experiment with these settings and re-enter the PIF and reset the Video Memory if what you chose was inadequate. If you selected High Graphics, enter the Advanced dialog box and check the Retain Video Memory option to ensure that there is always sufficient memory to redraw this application's screen. This option prevents Windows from reallocating an idle application's RAM to other uses. In addition to the KB Required box used by both modes, the 386-Enhanced Mode also sets the maximum memory an application can have as 640KB. Using the highest setting, however, prevents other applications from having any memory, effectively blocking them from running. To ensure that this PIF's application has as much memory as possible without affecting other applications running simultaneously, set the setting to -1, which allocates as much memory as possible to this application. EMS memory is expanded memory, which is different from extended memory even though both involve memory above 640KB. Set this up just as you would set expanded memory. Windows then will simulate expanded memory on the fly for the programs that need it, loading an expanded memory manager and releasing some of the system memory that it otherwise uses for Windows applications. As with extended memory, KB Required refers to the minimum amount of memory needed to run the application. Setting this to zero indicates that no expanded memory is required for the program to run, even though a little may help it run smoother. Be certain to set the KB Limit to prevent the application from taking all of the available EMS. Entering zero prevents Windows from assigning any expanded memory to the application, while a number above the minimum amount lets Windows allocate EMS and have some left for other applications. Display Usage lets you run the PIF's application in either full-screen mode or in a window. In full-screen mode, the mouse is dedicated to the application and unusable by others. If the application runs in a window, the mouse will remain operational for Windows. This option is only to bring the application up on the PC. After the application is running, you can toggle between full-screen and window views. The Execution boxes determine whether the application will run in the background and whether other applications also will run in the background. When you check the Background box, Windows will let the application continue running even when it's inactive or appears as an icon and other applications are running. (For example, you can let your DOS-based communications software remain in host mode in the background while you switch to a word processing program.) Checking the Exclusive box prevents any applications from running in the background while this application is active, even if those other programs are designed for background running. The benefit is that it lets the application use more memory and prevents competition for CPU access. The Advanced dialog box in 386-Enhanced mode requires additional information. | The Advanced 386-Enhanced Mode dialog box contains more settings that provide detailed control for multitasking, memory, display, and other options, including shortcut keys. In the Multitasking Options dialog grouping, the Background and Foreground Priority boxes let you determine the relative amount of CPU time for applications that are running simultaneously. Numerical options range from 0 to 10,000, although the default is 50 for the background and 100 for the foreground. If you want one program to have priority while in the background, set its number higher than the number for any other programs running in the background. Be certain, however, that the foreground number has the highest of the settings, ensuring that the application has more CPU time than any other. The Detect Idle Time box also should be checked. This option blocks Windows from allocating CPU time to an application that is idle and waiting for keystrokes. The Memory Options box lets you lock XMS memory, application memory, and EMS memory, and use the high memory area. Before altering these settings, check your application's documentation to ensure that you understand its memory requirements and whether it requires extended or expanded memory. The three lock options (for XMS, EMS, and conventional application memory) prevent Windows from swapping the data to hard drive when other applications need the memory. In the case of XMS and EMS memory, checking either box reduces the available memory but enhances performance by eliminating the time required to swap data to disk. When application memory is locked, however, overall Windows efficiency is degraded because it causes more swapping to disk by applications that are running simultaneously. The high memory area offers a way to prevent RAM shortages and is used by many memory-resident utilities, BIOS shadowing programs, and network drivers. It lets the application use the first 64KB of extended memory if no other programs are using it. The default setting is a checked box. If you're unsure what your applications need, leave it checked. Display Options lets you alter the way Windows controls the screen and the memory used to store screens when switching between windows. Generally, you can skip this option group unless your screen restores improperly after you switch windows or if the application is sluggish during screen updates. Typically, applications use DOS and BIOS to write to the screen. Some programs, however, write directly to the screen via the display card. You can use the Monitor Ports option in this group to have Windows monitor the interactions between the application and the display card so the screen reappears correctly when you switch windows. The High Graphics setting is the default because few applications need watching in the Text and Low Graphics modes. Some display adapters make this setting irrelevant. To correct sluggish screen response, try turning off all the Monitor Ports options. The worst that can happen is that they are prevented from returning to the application from Windows. In that case, either quit the application before returning to Windows or live with the sluggish response. The Emulate Text Mode option uses a default "on" setting to speed up text display. If you get meaningless characters on-screen with the application running or if the cursor is in the wrong position of the application, turn this option off. The Retain Video Memory option ensures that there always is sufficient memory to redraw the screen. Check this box. The final options group is a hodgepodge called Other Options. The Allow Fast Paste option speeds pasting from the Clipboard. If you have trouble pasting, try turning this application off. The Reserve Shortcut Keys option is the same as that option in Standard Mode. Within this group, the Allow Close When Active box lets you close an application's window without exiting the application, making it easy to lose data unless you always save before leaving a window. If, however, your application uses DOS file handles to flag open files, this option is less dangerous. It's still safer to avoid using this option. The Application Shortcut Key option lets you establish a hotkey command to switch between applications without clicking on the application's window or pressing ALT-ESC. To enter a key combination in this box, click on the text area and press the key combination you'll use to call up that application. This sequence must include either the ALT or CTRL key and may include both. Function keys also may be used, but choose a unique key combination to avoid conflict with other applications' commands. The ESC, ENTER, TAB, space bar, PRTSCR, and BACKSPACE keys can't be used in the sequence. After entering your key combination, choose OK. To erase a key, click on the text area and press SHIFT-BACKSPACE. Program information files let you have the best of DOS and Windows by choosing the applications that are most effective for your needs, regardless of whether they were written for DOS or Windows. The settings are simple, effective, and, perhaps most important, easy to change if you make an error. by Gail Dutton |