Copyright: Text copyright Nunke-Wohl 1993.


WinIT! Contents

                              WinIT! Copyright 1993, Nunke-Wohl

 Overview

WinIT! is a program launcher.   It exists so that you can type the name of a program built for Windows*(tm) at the DOS* prompt and cause it to execute. It can launch programs built for DOS as well.   Launches may be either automatic or manual. An automatic launch is one that begins executing a program simply by typing its name at the command prompt.  A manual launch requires that the launcher be run first.  For example, assume that you want to run a Windows(tm) hosted paint program named  WDPAINT.EXE.  To effect an  automatic  launch you would type

  WDPAINT

at the command prompt.  To effect a manual launch you would type

  WINIT WDPAINT

at the command prompt.  WinIT! always creates a new window in which the launched program runs no matter whether the launch was automatic or manual or whether the program was built to run under DOS or Windows(tm).

WinIT! is composed of three executable files:

WINIT.COM which runs as a  DOS TSR and which must be installed before Windows(tm).

WINITAPP.EXE which runs under Windows(tm).

WINITDLL.DLL which is a library that is loaded by WINITAPP.EXE.

WinIT! requires  enhanced mode Windows(tm) version 3.1.  If you install  WinIT!  and then start a version of Windows(tm) prior to 3.1, or then start Windows(tm) in standard or real mode, WINITAPP.EXE and WINITAPP.DLL will not run.

All three of these files must reside in the same directory. There is no need for the directory to be on your DOS path.  There are nonexecutable files, the file that contains this help text for example, that must reside in the same directory as well.  The setup procedure copies all of the files required by WinIT! to a directory that you specify.  None of the  files in WinIT!'s directory should be deleted or moved unless they all are.  Neither WIN.INI nor SYSTEM.INI are ever modified by WinIT!.

WinIT! can be configured to operate transparently.  Its window may be made invisible and it can be controlled via the Program Manager's Control Panel applet.  If you want to use the Control Panel to manage WinIT! you must copy the file WINITCPL.CPL to your system directory.  More information on the control panel is available by clicking on the 'Control Pan' button above.

*DOS refers to the MS-DOS operating system version 5.0 and above and compatible operating systems. MS-DOS and Windows are trademarks of the Microsoft Corporation.

Related Topics

Using WinIT! from the command prompt

DOS Command Summary

Installing WinIT!

Uninstalling WinIT!

Disabling WinIT!

Enabling WinIT!

Automatic Mode

Enhancing Programs

Manually launching Programs

Manually launching programs via an Association

Using the Print Manager

Launching DOS programs

Alternative ways of launching programs for Windows(tm)

Creating a DOS box

Waiting on launched programs

Hiding WinIT's main window

Making WinIT's main window visible

Programming Note

Tips, Tricks and Curiosities

Using WinIT! under Windows(tm)

Using the keyboard

The FILE menu

The OPTIONS menu

The DISPLAY menu

The HELP menu

The Configuration Dialog


Installing WinIT!

Before WinIT! can be used to launch any programs it must be installed.  It is suggested that you modify your AUTOEXEC.BAT file to install WinIT! whenever your computer is booted.  WinIT! is installed with the following command line:

  winit /install

This makes WinIT! resident in your system. In DOS parlance it becomes a 'TSR'.  WinIT! takes up about 2.5 kilobytes ( 2.5K ) when it is resident.  If you have appropriate memory management software it may be loaded into an upper memory block or 'UMB'.  You can use the DOS command LOADHIGH to install into a UMB with a command similar to the following:

  loadhigh winit/install

Alternatively you can use a third party memory manager.  Third party memory managers often allow you to make the most efficient use of upper memory by allowing you to specify the region in which TSRs load. Check your memory manager's documentation for the details.

WinIT! is capable of loading itself high if you have installed the proper extended memory and/or expanded memory drivers in your CONFIG.SYS.  WinIT! loads itself high with the following command:

  winit /install /high

In order to be loaded high, WinIT! requires a free UMB of about 10KB.  Once initialized, it will shrink the UMB to its resident size.

Finally, if WinIT! is to be installed at all it must be installed before Windows(tm).   WinIT! is a real-mode TSR.

Related topic

Uninstalling WinIT!


Uninstalling WinIT!

When WinIT! is no longer  required it may be uninstalled, that is removed from your system's memory.  To uninstall WinIT! enter the following command:

  winit /uninstall

WinIT! may not be able to uninstall itself.  This is because WinIT! is a TSR and it is not  always safe to uninstall a TSR.  WinIT! disables itself when uninstalling is not possible.  In this case WinIT! continues to reside in your computer's memory but may not be used to launch programs.  In other words, WinIT! remains installed but becomes disabled.  If you want to use WinIT! to launch programs after it failed to uninstall itself, you must enable it.

The following paragraph is intended for the technically minded. You need not understand it to be able to use WinIT!.

WinIT! hooks both the DOS interrupt (21h) and the multiplex interrupt (2Fh). WinIT! will fail to uninstall  whenever an active program or TSR hooks either of these interrupts after WinIT! has been installed.  Windows(tm) always hooks interrupt 2Fh. This means that it will not be possible to uninstall WinIT! while Windows(tm) is active.  (It is for this reason that there is no 'UNINSTALL' option on the FILE menu.)  If you have a need to be able to uninstall WinIT! then it should be the last TSR installed that hooks either of these interrupts.

Related Topics

Installing WinIT!


Disabling WinIT!

Whenever WinIT! is first installed on your computer it is enabled by default. If you want to suspend its program launching ability while allowing it to remain in memory it may be disabled. It is disabled with the following command:

  winit /disable

WinIT! is disabled automatically whenever a request to uninstall it is made. There are occaisions when it is not safe to uninstall WinIT! and when one of these arise it is disabled.

WinIT! may also be disabled from a menu under Windows(tm).

Related Topics

Enabling WinIT!

FILE - Disable


Enabling WinIT!

There are two situations in which you may want to enable WinIT!

One occurs after a failure to uninstall.  WinIT! always leaves itself installed but disabled in this situation.  If you later want to launch programs with WinIT! you must enable it. You can not simply install it because it is already installed.

A second occurs when you have previously and explicitly requested that WinIT! disable itself with the disable command.

WinIT! may also be enabled from a menu under Windows(tm).

Related Topics

Disabling WinIT!

FILE - Enable


Automatically Launching Programs

First a little background.  Programs for Windows(tm) are really composed of two executable files that are pasted together.  The first of these, often called the stub, runs whenever the program is run at the command prompt in DOS.  The second is run whenever the program is launched in Windows(tm).  In general, the program that runs under DOS does nothing more than write a single line to the monitor.  It is in the Windows(tm) portion where all of the application resides.

When WinIT! is installed it permits an 'AUTOMATIC' option. When this option is chosen, WinIT! intercepts all requests to run programs from the command prompt and checks to determine if the program was built to run under DOS or Windows(tm).  If the program was built to run under DOS then this request is passed to DOS and the program runs as it normally does.  When the program is built for Windows(tm) the request is not passed to DOS so that the stub is not permitted to run. Instead, WinIT! waives its magic wand to send a message to Windows(tm) that directs it to run your program  just as if you had clicked on its name.

The advantage of automatic launch mode is that it is flexible. You type the name of a program and it runs. No silly message for us.  The disadvantage is that intercepting requests to load programs slows down every load to some extent.  For many machines, especially those with a fast disk drive and a good cache this slowdown will prove to be insignicant.  Your disk drive will be asked to do some number of extra reads but who cares? You should experiment with automatic mode to see what effect it has on  your computer.  By default automatic mode is off before Windows(tm) begins to run and on thereafter.  This is so that you suffer no performance penalty under DOS.

Automatic mode can be engaged either in DOS or in a DOS box when Windows (tm) is running.  Automatic mode is turned on from DOS or from a DOS box with the command:

  winit /auto

and turned off with the command:

  winit /noauto

Automatic mode can be engaged in DOS boxes with the commands above or from the OPTIONS menu in Windows(tm):

Note that there are two defaults for automatic launch mode. One is for DOS and one for Windows(tm). The setting of the DOS default has no bearing on the Windows(tm) default and vice-versa.  To set the DOS default you should put either of the two commands above in your AUTOEXEC.BAT file after the command that installs WinIT!.  By default AUTOMATIC mode is off under DOS and on in DOS boxes. This makes the assumption that when you are not running Windows(tm) you are not likely to want to run any graphically oriented programs.  If you do not want the defaults, you must put one of the lines above in your AUTOEXEC.BAT file and/or use the menu above to set the default for DOS boxes.

Many programs built for Windows(tm) require the name of a file to act on.  For example, word processors require the name of a document and paint programs require the name of a bitmap.  When automatic mode is on, you can type the name of a program, follow it with a space and the name of a file to act on.  Most applications will use the file name as though it had been entered from its open file dialog box.  WinIT! always sets the default directory for the programs it launches from the current directory in the DOS session  from which a launch was requested.  If the file to act on resides in the current directory you will not have to fully qualify the file name.  If it does not then you will.

Two points should be noted.  First, not all programs for Windows(tm) are such that when run under DOS they simply type out the line "This program requires ...".  This is possible because the DOS portion of the executable can be anything that the developer wants it to be.  If automatic mode is on and one of these programs is run, whatever behavior it had at the DOS prompt is replaced  by WinIT!'s launch.  Normally, this is desired but not always.  For example, with automatic mode off type

  winver

at the DOS prompt. Compare that what happens when you type the same command with automatic mode on.  Second,  there is an alternative to automatic mode.  Some programs for Windows(tm) can be enhanced so that they run either at the DOS prompt or in Windows(tm) regardless of the state of automatic mode. Click on enhance for an discussion of this topic.

By default, after an automatic launch, your command shell is suspended as it is while a  program built for DOS is running.  If you need access to your command shell, type control/C to cause the command prompt to be redisplayed.  If you'd rather not have to type control/c to get access to the prompt, you can use the command

  winit /auto/nowait

so that control is returned to your command shell immediately after programs built for Windows are launced.

If you choose the /wait option, then when the launched program terminates, the errorlevel in the DOS box is set from the program's exit status.

The following paragraph is intended for the technically minded.  Most users can ignore it if they leave automatic mode off in DOS and on in Windows(tm).

Some VXDs have DOS stubs which listen for Windows(tm) initialization broadcast messages and then direct Windows(tm) to load themselves when Windows(tm) comes up.  These should not be run with automatic mode on in DOS.

Related Topics

Enhancing Programs

Alternative ways of launching executable for Windows(tm)


Enhancing Executables
Enhancing Programs

As an alternative to automatic mode,  executable files for Windows(tm) may be enhanced so that they run either from the DOS command prompt or in Windows(tm).  A utility is provided to perform this function.  Before enhancing a program you should determine that it performs no useful function under DOS.  To make this determination run it under DOS.  If it types a message that says it requires Windows(tm) then it  is a candidate for enhancement.  Assuming that you have a Windows(tm) hosted paint program named WDPAINT.EXE that you want to run from the DOS prompt, you would enter the command:

  winhance  d1:\path1\WDPAINT.EXE d2:\path2\WDPAINT.exe

Where d1 and path1 represent the drive and path of the executable to be enhanced and d2 and path2 represent that of the new executable name.

This command creates new program files.  It never, ever overwrites an existing program.  Let us repeat that.  It never, ever modifies one of your applications.  You should consider very carefully whether you should use this capability, and if you do,  you should make very sure that you have backup copies of your valuable software.  Things tend to get confusing when files with the same name exist in multiple directories.  After enhancing an executable you should test it to make sure it does what you expect.

Note that not every executable lends itself to being enhanced.  When Winhance is unable to enhance an executable it displays an error message and aborts.

How does Winhance do this you ask?  Well remember that programs for Windows(tm) are composed of a DOS stub and an application for Windows(tm). See the section on automatic mode for more information.  Winhance splits the executable into its stub and application components and creates a new executable. The new executable has a magic stub that sends a message to WINITAPP.EXE whenever it is run from the DOS prompt.  The application portion of the new executable is unchanged.  Because Winhance chooses not modify the application portion of the executable not every executable may be enhanced. To be more precise, Winhance will overlay the former DOS stub with its magic one but only it it can fit into the space in the file occupied by the original stub.

Enhanced programs may be launched from a DOS prompt whenever WinIT! is enabled regardless of the state of automatic mode.  In addition, there is no extra overhead involved in running enhanced programs as there is when automatic mode is on.

We do not recommend replacing an executable with an enhanced one in the same directory because it may tend to confuse some.  If you do this however, and if you run anti-virus software, this may trigger a virus alert.  The anti-virus software is doing its job in this case. It detects a change in an executable and it attributes it to a virus as programs are not expected to change.  Perhaps if you do this and you get no virus alert you should find out why not.

Finally, you should be aware of an incompatibility between enhanced executables and the use of the SHARE utility.  If SHARE is active, and you launch multiple instances of an enhanced program, it is likely to cause a sharing violation.

Related Topics

Automatic Mode

Alternative ways of launching programs for Windows(tm)


Alternative ways of launching Windows(tm) executables
Alternative ways of launching programs for Windows(tm)

There are at least a few ways that you can launch a program written for the Windows(tm) environment from the command line.  Your choices are enumerated below. Click on the underlined text in each option for more information.

Turn automatic mode on.

Enhance the executable in question so that it launches itself.

Manually request a launch with the command "winit program arguments"

Manually request a launch via an association with the command "winit /execute file"

Define a DOSKEY macro or an alias (if your command shell supports aliases) to do a manual launch.  If DOSKEY is installed on your system you might enter a command similar to "DOSKEY PAINT= WINIT WDPAINT.EXE".  In this example the PAINT macro name is being used to run the Windows(tm) program named WDPAINT.EXE.  You need not turn on automatic mode and you need not enhance the executable with this method.

Write a batch program that requests a manual launch. If the batch procedure has the same name as the executable and if it resides in a directory on your path, then simply typing the program's name will cause it to run.  You need not turn on automatic mode and you need not enhance the executable with this method.


Manually Launching Programs

You can use WinIT! to manually launch a Windows(tm) from a DOS prompt.  You run WinIT! and follow its name with the name of the program you want to run and any arguments you want to pass to the program.  For example to run a fictitious Windows(tm) paint program WDPAINT.EXE and to have it display the CHESS.BMP bitmap file you would enter the command:

  winit wdpaint.exe chess.bmp

In this example there is an implicit assumption that both the files WINIT.COM and WDPAINT.EXE reside in directories that are on your path. If that is not the case you will need to specify the path for WINIT! and/or the fictitious WDPAINT program.

Whenever WinIT! launches a program from a DOS prompt it sets the default directory for the spawned program to be the directory that is current in the DOS session from which you entered the command.  The WDPAINT program then would look for the CHESS bitmap then in your current DOS directory.  If that is not where it resides you would have to fully qualify the file name.

Related Topics

Automatic Launching Programs

Manually Launching Programs via an Association

Enhancing Programs

Alternative ways of launching programs for Windows(tm)


Tips, Tricks and Curiosities

WinIT! does not have to reside in your path.  Define a DOSKEY macro, a command shell alias or write a batch program with the same name and put it in your path.  If you use another operating system that provides the same functionality ( you know the one ) you can name the macro START. For example, DOSKEY START=d:\path\WINIT.COM $*

Our favorite command shell allows us to associate a file extension with a program.  Then when we type the name of file that is associated with a program it launches the program and passes it the file.  Well, if you associate files with a PIF extension with WinIT! then when you type the name of a PIF file without the extension, the shell launches WinIT! and WinIT! launches the program specified by the PIF.  With our shell we type "SET .PIF=c:\path\winit.com".  If, for example,  we type DOSPRMPT we get another copy of the command shell.

Some applications are such that they permit only a single instance of themselves to run at any time.  You can use this fact to switch the focus to one of these programs.  In a DOS box, type "progman" if you use the standard shell.  As the shell is already running, a second instance will run only until it switches input focus to the first instance.

Windows(tm) multitasks DOS sessions.  This means that it appears that programs running in different DOS boxes have concurrent access to the processor.  WinIT! does not support multitasking.  That is from the time WinIT! begins to launch a program from within a DOS box until the time when the request is completed, it will stall any other request from another DOS box.  Try this. Create two DOS boxes. Turn on automatic mode.  Turn on all error reporting. Enter the command "winit abc\def\ghi.exe".  You should see a message box that contains an error message. Do not dismiss it yet.  Go to another DOS box and type the name of a program built for Windows(tm).  This command will hang.  Now find the message box and click on 'OK'.  The second DOS box ends its wait and returns to the command prompt.

How many Windows(tm) programs can you launch with a single DOS command?  Turn on automatic mode and pick two executable files and enter the command "program1 | program2".  To DOS this is a command to run the first program and 'pipe' its output to the input stream of the second program which is to run next. If the DOS box in which you try this is set to execute in the background both programs will be run.  You can try this with as many programs as can fit on a single line.

How fast is WinIT! at launching programs?  Turn off automatic mode.  Take a small program and make an enhanced copy. The command to do this is "winhance drive:\path\program.exe a.exe". Then type in a DOS box the command "a | a | a | a | a | a | ... | a".  We think this is cool.

How fast can your system create DOS boxes?  If you enter "winit.com winit.com program" then WinIT will launch itself and this second copy will launch 'program'.  If you enter "winit.com  winit.com winit.com program" then you will be doing three launches.


Launching DOS programs

You can use WinIT! to launch a  program for DOS as well as for Windows(tm).  To do this you simply request a manual launch.  Windows(tm) will use its default PIF file.  You might do this if you had a need to run a lengthy program but wanted to continue to use your current DOS box for another purpose.  If that is the case it is probably best to set the default PIF file so that background execution is enabled and so that it runs windowed rather than full-screen.

If the program that you want to run has its own PIF file then you can launch it as well.  You might enter

  winit program.pif

for example.  If the PIF file does not reside on your path you must fully qualify its name.

You can use WinIT! to run DOS batch programs too.  What you do is launch your command shell and pass it the name of the batch file to run.  Some command shells will require a switch ( COMMAND.COM requires /C  or /K ) in order to pass a parameter.  Check your operating system documentation.  To launch the batch file MYBAT.BAT you would enter the command

  winit command.com /c mybat.bat.

WinIT! permits this command to be shortened to

  winit /s /c mybat.bat.  See the section on creating a DOS box.

Related Topics

Manually Launching Programs

Alternative ways of launching programs for Windows(tm)

Creating a DOS Box


Creating a DOS box

A DOS box is a window in which your command shell runs.  It is really more than that but this definition will do for now.  You can create a DOS box by launching your command shell.  Normally this is COMMAND.COM.  To create a DOS box then, you could type the command

  winit command.com

Because DOS boxes are so often useful, WinIT! permits a shortened version of the command.  You can type

  winit /shell

to do this as well.  In order for this to work there must be a COMSPEC variable in your environment whose value is the fully qualified name of your command shell.  You can pass a parameter to your shell if you want it to begin executing a command when the shell is created.  Some shells require switches in order to accept parameters.  COMMAND.COM requires /C or /K.  This switch should follow WinIT!'s as in the following example.

  winit /shell /c dir *.*

If you are lazy, you can abbreviate this to

  winit /s/c dir *.*


Programming note

When WinIT!'s automatic mode is on, any DOS program you write is capable of spawning a program for Windows(tm) almost as easily as one for  DOS.  WinIT! intercepts all DOS load and execute requests, interrupt 21h, function 4B00h regardless of whether these requests were made by COMMAND.COM or a program of yours.

Calls to the C language's runtime library function SPAWN that use the 'WAIT' option generate load and execute requests.  Therefore SPAWN may be used to launch a program built for Windows(tm) from within a DOS program.  Calls to the C language runtime routine SYSTEM load another copy of your command shell which then executes the DOS command passed to SYSTEM.  With  automatic mode on, WinIT! will intercept any attempt that SYSTEM makes to launch programs as well.

Enhanced programs do not require automatic mode. You can use SPAWN, EXEC or SYSTEM to request a load of an enhanced executable and have it run under Windows(tm).

The setting of the automatic mode WAIT option determines when calls to SPAWN, EXEC or SYSTEM return.  By default or if you enter the command

  winit/auto/wait

your program regains control when the program you spawned terminates.

If you enter the command

  winit/auto/nowait

your program regains control when the program you spawned begins to execute.

WinIT! does not concern itself with the language in which a program was written.  When automatic mode is on, any attempt to run a program that  uses DOS's load and execute mechanism is intercepted by WinIT! whenever it is installed.  Similarly any attempt to load and execute an enhanced executable is caught by WinIT! as well.  Included in the directory where WinIT! resides are files named WINIT.BAS and GWINIT.BAS.  For an example written in the BASIC language that demonstrates running a program for the Windows(tm) environment from DOS, you can enter the DOS command

  qbasic /run winit.bas

if your system has a copy of QBASIC installed

or enter the command

 gwbasic gwinit.bas

if your system includes GWBASIC.

Related Topics

Automatic Mode

Enhancing Programs


VXD
A VXD is a virtual device driver that runs under Windows(tm).


Errors - Beep
Report Errors Group

Beep

Checking this box in the Configuration Dialog will cause your computer to play a sound if an error arises when WinIT! attempts to launch a program.  WinIT! tries to play the sound associated with the exclamation point whenever a launch fails.

Checking this box will also cause your computer to play a the sound associated with the stop sign if WinIT! encounters a serious error from which it can not recover.

You can use the Control Panel sound applet to associate WAV files with sounds. See the documentation provided by Windows(tm) for more information on sounds.

We suggest that you check at least one of the boxes in the Report Errors group.


Errors - Windows
Report Errors Group

Windows*

Checking this box in the Configuration Dialog will cause your computer to display an error message in a Message Box in Windows(tm)  if an error arises when WinIT! attempts to launch a program.

We suggest that you check at least one of the boxes in the Report Errors group.

*Windows is a trademark of Microsoft Corporation.


Errors - DOS
Report Errors Group

DOS

Checking this box in the Configuration Dialog will cause your computer to display an error message in the DOS box  if an error arises when WinIT! attempts to launch a program.

We suggest that you check at least one of the boxes in the Report Errors group.


Display - Copyright
Display Group

Copyright

Checking this box in the Configuration Dialog will cause your computer to display WinIT!'s copyright message whenever Windows(tm) is launched and WinIT! is installed.


Display - Exit Warning
Display Group

Exit Warning

Checking this box in the Configuration Dialog will cause your computer to display a warning message whenever WinIT! is manually terminated.  WinIT! terminates without fanfare automatically whenever Windows(tm) does.


Forces - To Top
Forces  Group

To Top

The radio buttons in the Forces Group of the Configuration Dialog determine how the program being launched will be displayed.  If this button is depressd then the window in which the launched program runs will be forced to the top, that is it will have the input focus.  It will be forced to the top even if the launch was requested from a full-screen DOS box.

Note that after the program is launched it controls its own display.  Even it this button is not depressed the program may force itself to the top.


Forces - Windowed VM
Forces  Group

Windowed VM

The radio buttons in the Forces Group of the Configuration Dialog determine how the program being launched will be displayed.  If this box is checked then the DOS box in which the launch was requested will be forced to be displayed in a window if it it had been full-screen.  This option exists only to inhibit the tendency of Windows to iconize a full-screen DOS box after programs such as the terminal emulator applet set the focus to their main window.

This option will be unavailable unless WinIT!'s VxD was installed by WinIT's setup procedure.  The file containing the VxD is named "WINITAPP.386".


Forces - None
Forces  Group

None

The radio buttons in the Forces Group of the Configuration Dialog determine how the program being launched will be displayed.  If this button is checked, the launched program will be run but the previously active window retains the input focus.


The Configuration Dialog

The Configuration Dialog is chosen from WinIT!'s OPTIONS menu.

You can use it to customize the way in which WinIT! reports information to you and the way it displays the programs that you launch.

The dialog contains three groups that have related options.  Each option has a check box or a radio button.  When the dialog is displayed you can get help on its check boxes or radio buttons by depressing the F1 key.  The arrow keys can be used to move among the check boxes.  You can get more information by clicking on any of the topics below or by using the browse buttons above.

Related Topics

Report Errors Group

DOS

Windows(tm)

Beep

Display Group

Copyright

Exit Warning

Forces Group

To Top

Windowed VM

None


The OPTIONS Menu

The OPTIONS menu allows you to you to enable or disable automatic launch mode and to view the Configuration Dialog.  For more information on the items in this menu you can either use the browse buttons above or click on a related topic below.

Related Topics

Automatic Launch

Configuration Dialog

OPTIONS - Automatic Launch

OPTIONS  - Configuration


The FILE Menu

The FILE menu allows you to you to enable or disable WinIT! or to cause that portion that runs under Windows(tm) to exit.  Of course, when any of WinIT!'s components exit it is disabled.  For more information on the items in this menu you can either use the browse buttons above or click on a related topic below.

Related Topics

FILE - Enable

FILE - Disable

FILE - Exit


The HELP Menu

The HELP menu allows you to get help on using WinIT! or on using HELP.  For more information on the items in this menu you can either use the browse buttons above or click on a related topic below.

Related Topics

HELP - Contents

HELP - Search for Help on

HELP - How to Use Help

HELP - About


Using the Keyboard

Under Windows(tm), WinIT!'s main window is of the standard overlapped variety.  The only key which is treated specially by WinIT! is "F1".  The F1 key can be used to call up HELP anywhere it is available.


OPTIONS - Automatic Launch
OPTIONS Menu

Automatic Launch

This menu item enables or disables automatic launch mode. For a discussion of the automatic launch mode click on automatic.  When a checkmark appears to the left of the word automatic as it does above, automatic launch mode is on.  When no checkmark appears it is off.  You can change this setting in one of three ways:

by typing the letter 'A' when the OPTIONS menu is displayed

by tapping the return key when Automatic is highlighted

by clicking on Automatic

Related Topics

Automatic Launch Mode

The OPTIONS menu

OPTIONS - Configuration


OPTIONS - Configuration
OPTIONS Menu

Configuration

This menu item brings up the Configuration Dialog.  For more information on the Configuration Dialog click on configuration. You can bring up the Configuration Dialog box by:

typing the letter 'C' when the OPTIONS menu is displayed

tapping the return key when Configuration is highlighted

by clicking on Configuration

Related Topics

The Configuration Dialog

The OPTIONS menu

OPTIONS - Automatic Launch


Browse Buttons

Browse buttons are used to move forward or backward among a group of related HELP topics.


FILE - Enable
File Menu

Enable

This menu item enables  WinIT!.  This menu item is only available when WinIT! is disabled. WinIT! may be used to launch programs only when it is enabled.  You can enable WinIT! from the menu in one of three ways:

by typing the letter 'E' when the FILE menu is displayed

by tapping the return key when Enable is highlighted

by clicking on Enable

Related Topics

The FILE menu

FILE - Disable

FILE - Exit


FILE - Disable
File Menu

Disable

This menu item disables  WinIT!.  This menu item is only available when WinIT! is enabled. WinIT! loses its ability to launch programs when it is disabled.  You can disable WinIT! from the menu in one of three ways:

by typing the letter 'D' when the FILE menu is displayed

by tapping the return key when Disable is highlighted

by clicking on Disable

Related Topics

The FILE menu

FILE - Enable

FILE - Exit


FILE - Exit
File Menu

Exit

This menu item causes WinIT! to stop running.  Two of WinIT's three executable files terminate when this menu item is chosen.  The remaining one, the DOS TSR, can be terminated only if you uninstall it.  You choose this menu item in one of three ways:

by typing the letter 'X' when the FILE menu is displayed

by tapping the return key when Exit is highlighted

by clicking on Exit

Related Topics

The FILE menu

FILE - Enable

FILE - Disable


DOS Command Summary

The following recaps all of WinIT's commands.  You can click on the highlighted text for more information.  You can substitute a dash (-) for the forward slash (/) if you like.  Commands do not have to be typed in full.  You only have to type as much as will make the command unambiguous.

  WinIT /INSTALL[/HIGH]       - Makes WinIT! resident, optionally in upper memory

  WinIT /UNINSTALL            - Removes a resident WinIT!

  WinIT /ENABLE               - Reenables a disabled, installed WinIT!

  WinIT /DISABLE              - Disables an installed WinIT!

  WinIT /AUTO[/[NO]WAIT]      - Windowed programs run from the command prompt

  WinIT /NOAUTO               - Windowed programs do not run from the prompt

  WinIT /WAIT                 - Waits for the program launched last to complete

  WinIT /HIDE                 - Hides WinIT's main window

  WinIT /NOHIDE               - Makes WinIT's main window visible

  WinIT program  [args]       - Launch program in a window with optional arguments

  WinIT /SHELL[command][args] - Spawn command shell, command and arguments optional

  WinIT /EXECUTE[/WAIT] file  - Execute the program associated with a file

  WinIT /PRINT file           - Print a file using the program associated with it

  WinIT /HELP /VERBOSE        - Without /VERBOSE, either displays a command summary

  WinIT /? /VERBOSE           - /VERBOSE displays this file if Windows(tm) is active


Help - Contents
The HELP Menu

Contents

This menu item displays the table of contents of WinIT's help topics. You choose this item in one of three ways:

by typing the letter 'C' when the HELP menu is displayed

by tapping the return key when Contents is highlighted

by clicking on Contents

For more information on the items in this menu you can either use the browse buttons above or click on a related topic below.

Related Topics

HELP - Search for Help on

HELP - How to use Help

HELP - About WinIT!


HELP - Search for Help on
The HELP Menu

Search for Help on

This menu item allows you to search for a particular topic in WinIT!'s help file by

typing a keyword related to the topic of interest.  You choose this item in one of three ways:

by typing the letter 'S' when the HELP menu is displayed

by tapping the return key when 'Search for Help on'  is highlighted

by clicking on 'Search for Help on'

For more information on the items in this menu you can either use the browse buttons above or click on a related topic below.

Related Topics

HELP - Contents

HELP - How to use Help

HELP - About WinIT!


HELP - How to Use Help
The HELP Menu

How to Use Help

This menu item allows you get help on using the help system component of the Windows(tm) environment.  You choose this item in one of three ways:

by typing the letter 'H' when the HELP menu is displayed

by tapping the return key when 'How to Use Help' is highlighted

by clicking on 'How to Use Help'

For more information on the items in this menu you can either use the browse buttons above or click on a related topic below.

Related Topics

HELP - Contents

HELP - Search for Help on

HELP - About WinIT!


HELP - About WinIT!
The HELP Menu

About WinIT!

This menu item displays WinIT!'s version and copyright information.  You choose this item in one of three ways:

by typing the letter 'A' when the HELP menu is displayed

by tapping the return key when About is highlighted

by clicking on About

For more information on the items in this menu you can either use the browse buttons above or click on a related topic below.

Related Topics

HELP - Contents

HELP - Search for Help on

HELP - How to use Help


Processor Modes

There are three modes in which the processor runs:

 Real mode is the mode in which DOS programs run.

 Protected mode is the mode in which Windows(tm) runs.

 Virtual mode is the mode in which DOS boxes run.


TSR

A TSR is a program which remains resident even after it terminates, that is it Terminates and Stays Resident.  TSRs are generally used to coax DOS into doing things it does not want to do.


Windows(tm) Configuration files
WIN.INI and SYSTEM.INI are configuration files that are used by Windows(tm) and applications.  Often applications modify either of these files when they are set up making it difficult to remove them.


Windows(tm) modes

Depending on the version, Windows may run in one of three modes:

Real

Standard

Enhanced

WinIT! can launch programs only in enhanced mode.


PATH
The length of the PATH variable in your environment is usually limited to 128 characters though some command shells are more generous. We suggest not adding WinIT!'s directory to your path unless you have the space to spare.

If you use DOSKEY you can define a macro so that you won't have to specify a path explicitly to enter WinIT! commands:

  DOSKEY WINIT=d:\path\WINIT.COM $*


Function 4B00h
If this sounds like Greek to you don't worry about it.  Programs request services of DOS by issuing software interrupts. The service that is used to load a program file into memory and begin its execution is interrupt 21(hexadecimal), function code 4B00(hexadecimal).


GWBASIC
GWBASIC is a BASIC interpreter that is bundled with some versions of DOS.  If you want to run our GWBASIC example "gwinit.bas" click on GWBASIC to run a test


2BigFiles
If you want to to edit your AUTOEXEC.BAT file or your CONFIG.SYS file we'll help you.  Be forewarned that serious errors in either of these two files can prevent your computer from booting.  Backups are a very good idea.  Click on edit if you want to make a change to either or both files.


replace
The behavior is replaced but no changes are made to the program when automatic mode is on.  WinIT! simply does not permit the program's stub to run, it does not modify it.


PIF
PIFs are Program Information Files.  They are used to define the environment in which programs built for DOS can run under Windows(tm).  Windows(tm) provides a PIF editor that by default resides in the Program Manager's main group.  The PIF editor permits the creation and maintenance of PIF files.


PIFEDIT
Circled in red below are the PIF editor settings that we are talking about:

If you want to edit the PIF files for your command shell in Windows(tm), usually named DOSPRMPT.PIF or the _DEFAULT.PIF used when no particular PIF file is specified click on DOSPRMPT or _DEFAULT.


Waiting on Launched Programs

After you launch a program you can wait on its completion.  This is normally a useful thing to do in batch programs where you want a second program to be launched after the first one completes.  If WinIT!'s automatic mode is on and the WAIT option has been chosen by default or with the command

  winit auto/wait

then control will not return to your batch program until the program you launced terminates.  If you use any other of the means previously described to launch a program, you can wait on its completion with the command

  winit /wait

This will cause the DOS box in which this command was run to go to sleep. It will wake up when the last program you launched terminates or when you type control/C.  WinIT! sets the errorlevel in the DOS box from the exit status of the program you launched.  In general, DOS programs are more likely to set an errorlevel on their completion than programs for Windows(tm).

Note that WinIT! waits on the last successfully launched program.  Bear in mind that launches may fail for lack of memory if you have many tasks in progress.  For this reason you should check on the status of the launch before waiting as in the following example

  winit program.exe

  if not errorlevel 1 goto ok1

  echo Failed to launch Program.exe

  goto end

  :ok1

  winit /wait

  if not errorlevel 1 goto ok2

  echo Program.exe terminated unsucessfully

  goto end

  :ok2

  echo Program.exe completed successfully

  :end

  ...


ERRORLEVEL

After programs have terminated, they can return a number to DOS. This number, sometimes called the error level or the exit code, can be tested by batch programs.  By convention, programs that complete successfully return an error level of zero.  A batch program can run a program, wait for it to complete and then check its errorlevel.  Depending on this test, the batch program can, for example, choose to continue or to display an error message.


UMB

A UMB is an upper memory block.  That is, it is an area of memory beyond the first 640 kilobytes and within the first megabyte.  Originally memory beyond the 640k barrier was set aside for ROM BIOS code and device adaptors.  Modern memory managers are able reclaim unused blocks of the set aside memory.  These blocks are referred to as UMBs.


Hiding WinIT!
Hiding WinIT

After you have installed and configured WinIT! you may want to remove it from view.  If you choose to do that, WinIT! is still available to launch programs but it will take up no room on your monitor's display.  WinIT's window is made invisible with the command

  winit /hide

To make it visible again you can either use the Control Panel or the /NOHIDE command.  For help on using the Control Panel, click on the button labelled 'Control Pan' above.

Related Topics

Control Panel

Unhiding WinIT!


Control Panel
                              WinIT! Copyright 1993, Nunke-Wohl

Using the Control Panel

This is an abbreviated help file for WinIT!, a program launcher.  It describes how the Control Panel may be used configure WinIT! for your system.  More detailed help on WinIT! is available by clicking on the button labelled 'Main' above.

In order to use the Control Panel to configure WinIT! you must have copied the file that contains WinIT!'s control panel extension, WINITCPL.CPL ,to your Windows(tm) system directory.

To configure WinIT! via the Control Panel you first click on the Control Panel icon in the Program Manager group.  If WinIT! is active you will see its icon.  Double clicking on its icon will bring up WinIT!'s dialog box.  You can not configure WinIT! with the Control Panel if it is not active.

The dialog box is composed of check boxes and radio buttons.  By clicking on a check box you can choose or not choose a particular option.  Radio buttons work similarly except that they come in groups, and only one button may be chosen from a group.

The dialog box is organized in five sections:

  Active State  	-   Makes WinIT!  available or not

  Launch Mode	-   Makes WinIT launch programs automatically or not

  Report Errors	-   Determines how errors are displayed

  Display	-   Displays informational message boxes and the main window  or hides them

  Forces	-   Determines how the window of a launched program is displayed

You can get more information by clicking on the browse buttons above or by clicking on the related topics below.  Pressing the F1 key at anytime when the dialog box is displayed will pop up a window containing help for the currently selected check box or radio button.

Related Topics

Active State Group

Enabled

Disabled

Off

Launch Mode Group

Automatic

Manual

Report Errors Group

DOS

Windows(tm)

Beep

Display Group

Copyright

Exit Warning

Hidden

Forces Group

To Top

Windowed VM

None


Unhiding WinIT!
Unhiding WinIT

If WinIT's main window is hidden you can force it to be displayed  with the command

  winit /nohide

Related Topics

Control Panel

Hiding WinIT!


CP - ACT - ENABLE
Active State Group

Enabled

Checking this button permits WinIT! to launch programs.  WinIT! is enabled by default whenever it is installed.


CP - ACT - DISABLE
Active State Group

Disabled

Checking this button causes WinIT! to lose its ability to launch programs.  WinIT! is enabled by default whenever it is installed.


CP - ACT - OFF
Active State Group

OFF

Checking this button causes WinIT! to terminate.


[Blank Page]


CP - MODE - Auto
Launch Mode Group

Automatic

Checking this button causes programs for Windows(tm) to run whenever you type their names at the command prompt as long as WinIT! is enabled.


CP - MODE - Manual
Launch Mode Group

Manual

Checking this button prevents programs for Windows(tm) from running when you type their names at the command prompt.  If WinIT! is enabled, you can run a program from the DOS prompt with the command

  winit program arguments


CP - ERR - DOS
Report Errors Group

DOS

Checking this box will cause your computer to display an error message in the DOS box  if an error arises when WinIT! attempts to launch a program.

We suggest that you check at least one of the boxes in the Report Errors group.


CP - ERR - Windows
Report Errors Group

Windows*

Checking this box will cause your computer to display an error message in a Message Box in Windows(tm)  if an error arises when WinIT! attempts to launch a program.

We suggest that you check at least one of the boxes in the Report Errors group.

*Windows is a trademark of Microsoft Corporation.


CP - ERR - Beep
Report Errors Group

Beep

Checking this box will cause your computer to play a sound if an error arises when WinIT! attempts to launch a program.  WinIT! tries to play the sound associated with the exclamation point whenever a launch fails.

Checking this box will also cause your computer to play a the sound associated with the stop sign if WinIT! encounters a serious error from which it can not recover.

You can use the Control Panel sound applet to associate WAV files with sounds. See the documentation provided by Windows(tm) for more information on sounds.

We suggest that you check at least one of the boxes in the Report Errors group.


CP - DIS - Copyright
Display Group

Copyright

Checking this box will cause your computer to display WinIT!'s copyright message whenever Windows(tm) is launched and WinIT! is installed.


CP - DIS - Exit
Display Group

Exit Warning

Checking this box will cause your computer to display a warning message whenever WinIT! is manually terminated.  WinIT! terminates without fanfare automatically whenever Windows(tm) does.


CP - DIS - Hidden
Display Group

Hidden

Checking this box will cause WinIT's main window to be hidden.  To make the window visible again you must either uncheck the box or enter the command

  winit /nohide

at the command prompt in a DOS box.


CP - FRC - ToTop
Forces  Group

To Top

If this button is checked then the window in which the launched program runs will be forced to the top, that is it will have the input focus.  It will be forced to the top even if the launch was requested from a full-screen DOS box.

Note that after the program is launched it controls its own display.  Even it this button is not depressed the program may force itself to the top.


CP - FRC - WindowedVM
Forces  Group

Windowed VM

If this box is checked then the DOS box in which the launch was requested will be forced to be displayed in a window if it it had been full-screen.  This option exists only to inhibit the tendency of Windows to iconize a full-screen DOS box after programs such as the terminal emulator applet set the focus to their main window.

This option will be unavailable unless WinIT!'s VxD was installed by WinIT's setup procedure.  The file containing the VxD is named "WINITAPP.386".


CP - FRC - None
Forces  Group

None

If this button is checked, the launched program will be run but the previously active window retains the input focus.


Windows Directories
Windows(tm) generally creates two directories on your disk.  The first typically contains the applications that ship with Windows and the DOS program, WIN.COM,that you use to launch it.  The second directory is a subdirectory of the first and that contains the files USER.EXE, GDI.EXE and KRNL386.EXE.  It is this directory to which you must copy the Control Panel extension.


QBASIC
QBASIC is a BASIC interpreter that is bundled with some versions of DOS.  To run our QBASIC example "winit.bas" click on QBASIC.


The DISPLAY Menu

The DISPLAY menu allows you change the way WinIT! displays information to you.  You can cause the display to be removed from your desktop, choose a font or a background color.  For more information on the items in this menu you can either use the browse buttons above or click on a related topic below.

Related Topics

DISPLAY - Hide the Main Window

DISPLAY - Fonts

DISPLAY - Colors


DISPLAY - Hide the Main Window
DISPLAY Menu

Hide the Main Window

This menu item removes WinIT!'s main window from your desktop.  Once configured, there is really no reason to display the window.  You can make the window visible again by entering the following command in a DOS box

  winit/nohide

Alternatively, if WinIT!'s control panel extension is installed you can uncheck the box labelled 'Hidden' in the 'Display' group.

Related Topics

DISPLAY - Fonts

DISPLAY - Colors


DISPLAY - Fonts ...
DISPLAY Menu

Fonts ...

This menu item calls up the standard dialog which allows you to change the font that WinIT! uses to report information about launches.

Related Topics

DISPLAY - Hide the Main Window

DISPLAY - Colors

The FONTS Dialog


DISPLAY - Colors ...
DISPLAY Menu

Colors ...

This menu item calls up the standard dialog that allows you to choose the background color of WinIT!'s main window.

Related Topics

DISPLAY - Hide the Main Window

DISPLAY - Fonts

The Colors Dialog


Fonts Dialog
The Fonts Dialog

The Fonts Dialog is chosen from WinIT!'s DISPLAY menu.

You can use it to customize the way in which logs information about programs that you launch. You click on a font, a font style, a font size and a color.  A preview of your chosen font is shown in the SAMPLE window.  WinIT! limits your choice of font to screen fonts which contain ANSI characters.  WinIT! automatically sizes its window so that it is no larger than it needs to be to display five lines of text.  WinIT! does not place an upper limit on the size of the window.  It is possible to choose a point size which will cause WinIT!'s window to exceed the size of your monitor.


Colors Dialog
The Colors Dialog

The Colors Dialog is chosen from WinIT!'s DISPLAY menu.

You can use it to customize the background color of WinIT!'s main window. The dialog contains forty-eight basic colors.  If you see one that pleases you, click on it and then click on the OK button.

If you do not see one that you like then you can define your own custom color.  To do this, click on the button labelled "Define custom colors ...".  Next drag the two controls circled in red below until the color you want is in the box circled in blue.  The box sometimes contains two colors, one solid and one not.  If you want the solid one you must type ALT/O.  At this point you can either click OK or on "Add to custom colors".  If you have chosen the latter option, then your new color will be available in the Custom Colors section of the dialog immediately below the basic colors section. This saves you the trouble of defining a new custom color the next time you use this dialog. You may define up to sixteen custom colors with this method.

Finally, click on OK to cause WinIT! to repaint its window using the chosen color, whether basic or custom,  or on Cancel to leave the window as it was.


Manual Association
Manually Launching Programs via an Association

Windows(tm) allows file types to be associated with the applications that generated them.  If you double click on a file that has an association then the program that generated it is launched.  You can do a similar thing under DOS.  You specify a file and tell WinIT! to launch the associated application. If you were to type

  winit /execute chess.bmp

for example, WinIT! would manually launch the program associated with this bitmap.  In this example that would be the paint applet.  If you have Video for Windows (tm) and were to type

  winit /execute wndsurf1.avi

Windows(tm) would play the movie.  It is in the latter example where this command is most useful.  If you were to enter the command

  mplayer wnsurf1.avi

 with automatic mode on, the media player would launch but in order to play the movie you would have to click the play button.  With the /execute command the movie is played without a click.

When you launch a program in this way, control returns to your shell almost immediately.  To wait on the program's completion you can use the /WAIT option on the same line as in

  winit /execute /wait wndsurf1.avi

or you can use the /WAIT command on a line by itself as in

  winit /wait

Refer to the documentation on Windows(tm) for information on how to associate a file type with an application.

Related Topics

Automatic Launching Programs

Enhancing Programs

Alternative ways of launching programs for Windows(tm)


Print Manager
Using the Windows(tm) Print Manager

Windows(tm) allows file types to be associated with the applications that generated them.  When you select a file displayed by the file manger and choose PRINT from its FILE menu, Windows will launch the associated application to print the file.  WinIT! allows you to use the print manager under DOS.  You specify a file and tell WinIT! to print it. If you were to type

  winit /print text.wri

for example, WinIT! would manually launch the program associated with this file.  In this example that would be the write applet.  Note that if a file is not associated with an application that WinIT! will be unable to print it.

Refer to the documentation on Windows(tm) for information on how to associate a file type with an application.