Copyright: Copyright ® 1993 Prodigy Computing


Contents

Quick Start

Detailed Discussion

The Problem

What wfListen Does

Differences between Using wfListen and Using the Receive | Setup Dialogue

Using wfListen

Command-line Usage

Menu Usage

Licence and Acknowledgements

Licence

Acknowledgements

Feedback

Report defects and make suggestions here.


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. The way it does this is different from most other communications programs. Most other programs set the modem to Auto-Answer and then monitor the DSR (data set ready) line. But WinFax switches Auto-Answer off at the modem and monitors the RI (ring indicator) line.

The Problem with Windows Communications Programs

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. You can tell Windows to take the modem away from WinFax, which it will. Or you can avoid the problem by going into WinFax beforehand and switching off automatic reception. Go to Receive | Setup and uncheck Automatic Reception. Press OK and all will be well.

Either of these actions will turn automatic reception off. However, it's easy to forget to turn it back on again, and you might go a whole day with your fax reception inadvertently turned off.

The Problem with DOS-based Communications Programs

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.

The Ideal Solution to the Problem

What one would like is to have some automatic way of turning automatic reception off before starting a communications program, and turning it back on once the 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. Consult your Windows 3.1 manual, or GO MSWIN on CompuServe for more details.


Microsoft Excel

A spreadsheet program for Windows. Microsoft Corporation, 1 Microsoft Way, Redmond WA 98052-6399.


Microsoft Visual Basic

A programming language and rapid development environment for Windows. Microsoft Corporation, 1 Microsoft Way, Redmond WA 98052-6399.


Microsoft Word for Windows

A word-processing program for Windows. Microsoft Corporation, 1 Microsoft Way, Redmond WA 98052-6399.


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.


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.


WinBatch

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


What wfListen Does

WfListen solves the problem by sending WinFax a DDE message to disable automatic reception and re-enable it afterwards.

You don't have to use wfListen: 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. WfListen is intended for WinFax users who do not care to do their own DDE programming.

WfListen 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.


Differences between Using wfListen and Using the Receive | Setup Dialogue

What wfListen does is not entirely equivalent to switching automatic reception on and off using the Receive | Setup dialogue.

The difference is that when wfListen switches automatic reception off, it also inhibits scheduled sending.

Imagine, for example, if you have a fax that is scheduled to be sent at some time in the future. Then you use wfListen to switch off automatic reception, because you wish to use a communications program. Suppose that the scheduled time for the fax to be sent comes around before wfListen has switched automatic reception back on. WinFax will not send the scheduled fax until wfListen does switch automatic reception back on.

Similarly, suppose you go offline but you leave your communications program running and iconized. WfListen will of course still be waiting for that program to terminate. If you switch to WinFax and compose a fax for immediate transmission, it will not be sent until you do one of the following:

        Exit from the communications program so that wfListen switches automatic reception back on.

        Double-click on the wfListen icon to activate it, and manually select Automatic Reception | Enable.

A moment's reflection will convince you that this is in fact desirable behaviour.


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:

If you are not using a PIF, the process is identical. If your communications program requires command-line parameters, simply put the parameters after the name of the program just as you would if you were running the program from a DOS prompt.

If you are using a PIF, put the command-line parameters in the PIF.


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 [parm1 parm2 ...]

Sends WinFax a message to disable automatic fax reception

runs mypgm.exe, optionally passing it the parameters parm1, parm2 etc

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" or "Program mypgm.exe not found to launch" and wfListen will wait for a single menu command before terminating.

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 wfListen's 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. This second sense of "path" is not intended here.


Menu Usage

It will be clear from the discussion that wfListen is intended always to be used in one of its silent forms, with its operation controlled by a command-line parameter rather than by the pull-down menu.

The menu interface is provided so that you can experiment with the program, and 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, or is in the process of configuring the modem.

REQUEST_ACTIVE	Automatic reception and sending are both disabled but WinFax wants to send a fax.

This status accurate when wfListen starts, and each time you activate the program. In the interests of performance, 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 link 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.


Problem Reports

If you report problems with wfListen, we will be glad to try and resolve them. If you have suggestions about how the program could be improved to be more useful to you, they will be welcomed.

Please report problems or suggestions to Paul Keating, CompuServe 73770,660. To help us, please pull down the About box from the Help menu and note the Program Revision and Resource Revision number.


Change Log

This is a summary of the changes to the program.

Release 2.1 incorporates the following changes:

Application error -1 when the About box is selected no longer occurs.

Program now distinguishes between an invalid command-line parameter (that is, a single character other than 0 and 1) and the name of a program that could not be found.

Program now passes command-line parameters to the launched communications program if required.

Program now refreshes the status of the modem whenever it receives or loses the focus, and a menu option is provided to force a refresh.


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.