Copyright: Copyright ® 1993 Prodigy Computing


Contents

Quick Start

Detailed Discussion

The Problem

Using a Windows Batch File

What wfListen Does

Using wfListen

Command-line Usage

Menu Usage

Licence and Acknowledgements

Licence

Acknowledgements


The Problem

In WinFax, when you switch automatic fax reception on, it initializes the modem in a particular way and then "listens" for a ring.

If you try to use a Windows-based communications program, such as Windows Terminal or WigWam, Windows will realize that WinFax is listening to the modem and notify you of a conflict.

But many WinFaxers use DOS-based communications programs, such as Tapcis, CompuServe Information Manager, Telix, and others. When you run these programs from Windows, they usually reset your modem for their own purposes. Once they have done this, WinFax will no longer answer the phone.

While you are using the communications program, you are unlikely to receive calls, so this is not a problem. But when you exit from your communications program, you would like automatic reception to be switched back on.

WinFax is unaware that anything has changed at the modem, so as far as it is concerned, automatic reception is still enabled. But it will not know when the phone rings, and will not answer.

You can cure this by hand quite easily.  Go to Receive | Setup and check Automatic Reception (it's probably already checked, anyway). Press OK and all will be well.

However, this is easy to forget, and you might go a whole day with your fax reception inadvertently turned off.

What one would like is to have some automatic way of turning automatic reception back on once the DOS program has finished.


WigWam

A Windows forum navigator for CompuServe. Ashmount Software, CIS 75300,250. GO UKCOMP on CompuServe for more details.


Windows Terminal

A terminal application supplied by Microsoft with Windows 3.1. Microsoft Corporation, 1 Microsoft Way, Redmond WA 98052-6399. GO MSWIN on CompuServe for more details.


Tapcis

A DOS-based forum navigator for CompuServe. Support Group Inc, Lake Technology Park, McHenry MD 21541. CIS 74020,10. GO TAPCIS on CompuServe for more details.


Telix

A widely-used DOS-based terminal program. Exis Inc., P.O. Box 130, West Hill, Ontario, Canada M1E 4R4.


Compuserve Information Manager

A desktop-metaphor point-and-click front end for CompuServe, available in both DOS and Windows versions. CompuServe, PO Box 20212, Columbus OH43220. GO CIMSUP for more details.


Using a Windows Batch File

If you execute your DOS program directly (that is, from File Manager or from Program Manager, with or without a PIF), there is not much to be done about the problem. But you can use a Windows batch language. Batch files do not come built into Windows the way they come built into DOS. They are an optional extra. One such is Batch Runner, which comes as part of Norton Desktop for Windows. Batch Runner has a shareware equivalent called WinBatch.

If you have one of these products, you can send keystrokes to WinFax after your DOS program has finished, thus automating the Receive | Setup sequence. But this is not 100% satisfactory, because the Automatic Reception checkbox, like all Windows checkboxes, is a toggle. There is no way to send a keystroke that says "check this box whether it's already checked or not", and there is, of course, no way for your batch program to look at the screen.


PIF

Program interface file, a file that specifies the kind of DOS environment that Windows needs to provide to a DOS application for proper operation.


Norton Desktop for Windows

A Windows shell that replaces both File Manager and Program Manager, and includes several utilities including a Windows batch interpreter. Symantec Inc.


WinBatch

A Windows batch interpreter. Wilson WindowWare, 2701 California Ave SW #212, Seattle, WA 98116.


What wfListen Does

There is an alternative to sending keystrokes to WinFax. You can send WinFax a DDE message to enable automatic reception. The message is [FAXMNG] control=GoActive. There are a number of Windows tools that allow you to do this. WinBatch is one; you can also use Visual Basic, or the macro facilities in Word or Excel.

Or you can use wfListen. It does the following:

        It sends a DDE message to WinFax, switching automatic reception off.

        It then runs a communications program and waits for it to finish.

        Finally, it sends another DDE message to WinFax to switch automatic reception back on.


Using wfListen

Using wfListen is very straightforward. Suppose currently you are running Tapcis from Windows via a PIF. You will have an icon in Program Manager that is set up to look much like the dialogue box below:

Change this so that wfListen runs first (to switch off automatic reception). Pass it the name of your DOS communications program as a parameter, like this:

That's all.


DDE

Dynamic data exchange, a mechanism for Windows programs to exchange data and issue commands to each other.


*Command-Line Usage
Command-Line Usage

When you run wfListen, it takes one optional parameter, which can either be a program name, or else have the value 1 or 0.

wfListen.exe mypgm.exe

Sends WinFax a message to disable automatic fax reception

runs mypgm.exe

waits for it to finish

switches automatic reception back on

silently terminates.

wfListen.exe 1

Sends WinFax a message to enable automatic fax reception

silently terminates.

wfListen.exe 0

Sends WinFax a message to disable automatic fax reception

silently terminates.

wfListen.exe

Establishes a DDE link with WinFax but sends a message only when asked.

This you have to do from the menu.

If the parameter you supply is neither 0 nor 1 nor the name of a program in your path, you will get the error message "Invalid command line parameter" and wfListen will act as though no parameter had been supplied.

The parameterless option is designed primarily for testing, not for normal use.

The parameters 0 and 1 may be useful in Windows batch applications.

Testing wfListen

To test the program, run it with no parameters from Program Manager's File | Run dialogue.Bring up WinFax beside it, positioned so that you can see the "Auto Receive : Enabled" status line at the bottom of the WinFax control panel. Next, use the Automatic Receive | Disable and Automatic Receive | Enable menu options. You should see the status line change in WinFax, and (if you have an external modem with status lights) you should be able to verify that WinFax is "talking" to your modem when you select Enable. See menu usage for a full discussion of this.


Path

There is a DOS environment variable called PATH which tells the system where to look for programs to be run. It takes the form of a list of directories. The system starts in the current directory and then searches each of the listed directories in turn, looking for the program you have specified. This is so that you can run a program without having to remember exactly where it is.

"Path" is also used in another sense, meaning the full name of a program including disk and subdirectory, for example C:\TAPCIS\TAPCIS.EXE, which is called the path, full path, or pathname, in contrast to simply TAPCIS.EXE, which is then called the filename.


Menu Usage

It will be clear from the discussion that wfListen is intended always to be used from a batch file. The menu interface is provided mainly as a place to hang this help file.

When you start wfListen, it will briefly display the status "WinFax status unknown". If WinFax is running, this will be replaced almost immediately with one of the following statuses:

ACTIVE	Automatic reception is enabled

IDLE	Automatic reception is disabled

BUSY	WinFax is currently sending or receiving.

REQUEST_ACTIVE	Automatic reception is disabled but WinFax wants to send a fax.

This status is only accurate when wfListen starts. No continuous monitoring is done. If you go to WinFax itself and change the reception status, you will not see the status change in wfListen's window.

From Automatic Receive menu, you can select Enable or Disable. This sends the appropriate DDE message, and rechecks the status.

When you select Enable, wfListen sends a message to WinFax, which in turn tells MOD.EXE to reinitialize the modem. This takes a while: up to 10 seconds on slow modems. If you select Enable again while MOD.EXE is sending the initialization string, it will send another one, interleaved with the first, which is likely to confuse your modem utterly, to the point where you have to switch it off and on again to get control back.


MOD.EXE

WinFax's modem control program.


Licence

Copyright

This program and supporting materials was written by Paul Keating and is copyright © 1993 by Prodigy Computing (Pty) Limited, PO Box 2194, Cramerview 2060, South Africa. Supplied with the program is a dynamic linki library, BWCC.DLL which is copyright © 1991–1992 by Borland International, PO Box 660001, Scotts Valley CA95067-0001, USA, and which is redistributed by permission of the copyright owner.

Usage Licence

You are granted a non-exclusive licence to use the program WFLISTEN.EXE without payment. The program is made available voetstoots, that is, without warranty of any kind against defects latent or patent. You assume all responsibility for the adverse consequences of any defects. If the program does not work, or if it works differently from the way you expected or intended or were led to believe, you sole remedy is to stop using it.

Distribution Licence

You may distribute the program freely to others, provided that you distribute the program and its supporting materials and BWCC.DLL together as a unit, and provided also that you may not charge any money for the program. You may charge a reasonable fee for copying the program.


Acknowledgements

WinFax is a trademark of Delrina Technology Inc. Other products have been mentioned in this documentation by way of example and the owner or distributor of each has been identified insofar as this has been possible. The status of these product names should be ascertained from the owners or distributors.

The author would like to thank Pat Ritchey (of Team Borland on CompuServe) for his WinExecAndWait() function, the lack of which made the previous version of wfListen a much less useful program.