Communications Time Monitor Version 2.1

Copyright © 1995, Scott A. Craig - All Rights Reserved

Read These Sections Before Using This Software ...

 Copyright Information and Disclaimer

 Problem Reports and/or Reaching the Author

General Information ...

 Introduction

 Whats New For Version 2?

 Program Operation

 Program Configuration

 Command Line Parameters

 INI File Structure

 Revision History


PROGRAM CONFIGURATION

Use this option to configure the programs options.  When the command is selected, this dialog box will be displayed.  The dialog is divided into two sections.  The top half of the dialog defines how the program starts its timer.  The bottom half defines how the program starts, and ends.  In the top half are two buttons labelled Start Timer When Carrier Is Detected On COM1: through COM4: and Manual Start Only.  When Manual Start Only is selcted (the default) the program will begin timing only when the Start button on the main dialog is pressed.  When Auto Detect Start is selected, the program will automatically detect when a carrier to your modem is present, and begin timing at that point.  The serial port labels (COM1: through COM4:) are initially dimmed.  These can only be selected when Auto Detect Start is selected.  In Manual Start mode, they are not used, and therefore have no meaning.  After selecting Auto Detect Start, you must select the serial port that your modem is connected to (COM1 through COM4) for the Auto Detect feature to work properly.

The bottom half of the dialog sets options that control how the program starts and ends, and whether it automatically Resets the session timer each time the timer is started.

AUTO RESET ENABLED controls whether or not the Session counter is reset to zero each time the timer is started.  When this option is selected, the program will reset the session timer to zero each time a session is started.  If it is not selected, the session timer will simply start counting from where it left off each time a session is started.

START MINIMIZED defines whether the program starts as a full dialog box (the default) or as an Icon (in Minimized form).  There is an additional Check Box beside this one labelled ONLY BY COMMAND LINE.  This button is very handy if you start the program from a Script file, and you would like it minimized, but still want the program in its full-size mode when you start it normally.  If this button is checked AND START MINIMIZED is checked, when the program receives a parameter passed on the command line, it will start minized.  If the START MINIMIZED button is checked, and this button is NOT checked, the program will ALWAYS start in a minimized format.

EXIT ON CARRIER DROP controls whether or not the program will end itself when it senses that the carrier from the modem has been lost.  If this box is checked, the program will close itself as soon as the carrier to the modem drops.  As with the Start Minimized command, there is a  check box to modify this command so that it is only active when a parameter is passed on the command line.  It is also very handy when you launch the program from a Script file such as used with Trumpet Winsock.  Use the script file to dial your Internet Provider, and when you execute the Bye command and the carrier drops, the program will automatically exit.  This prevents having multiple timers running if you dial several times.

DISPLAY SUMMARY will also only be enabled if EXIT ON CARRIER DROP is enabled.  If this check box is enabled, a message box displaying the session time and total time for the selected connection will be displayed when the program exits.

DISPLAY UPDATE INTERVAL - This value represents the number of milliseconds (1/1000 of a second) between display updates.  The default of 100 will cause the display to be updated 10 times per second.  If this seems to put too much of a load on your system, increase this value.  250 will update the display 4 times per second, 500 will update the display 2 times per second, 1000 will update the display once per second.  If you set the value higher, you may notice the time changing somewhat erratically occasionally.  This is normal because the actual timer used to get the connect time is more accurate than the timer used for the display.  Occasionally the display will have to Catch Up with the true time.


REVISION HISTORY

This program is getting a little more complex than I first envisioned, so to keep track of the changes, I included this section.

06/04/95 - Version 1.0 - Initial release of Version 1.0.

06/06/95 - Version 2.0 - Initial release of Version 2.0

06/14/95 - Version 2.0a - Fixed a bug in the display function that caused a GPF when the total time exceeded about 10 hours.  I know better than to use 16-bit Ints for long values!

06/18/95 - Version 2.1 - Added a configurable MessageBox to display the session and total times if the program is exited when the CD drops.  Added the ability to remove a Connect without having to edit the INI file.  Revised Exiting logic.  Revised timers to resolve clock running slow, and added display update variable to the config dialog.  Since there was a probability that people have already configured Script files to use the program name CCM20.EXE, the name of the executable and help files was not changed even though the version changed.


General Program Operation
PROGRAM OPERATION

This is the main programs display.  There is a Drop Down List Box at the upper left of the dialog that contains your Connections.  The one shown here is for Netcom.  You can select a different Connection by clicking on the down arrow, and selecting the desired connection from the list box.  To add a new connection or service, select the [NEW ENTRY] at the bottom of the List Box, and then click the EDIT button below the edit field.

The Edit Dialog box is as shown here.  There are 4 controls on the dialog that you can set.  The TITLE is the title of the connection that will be displayed in the list box.  There is a check box labelled PROGRAM with an edit field beside it.  If this box is checked, the LAUNCH button can be used to start the program whose name is entered in the edit field.  If the program is not in your Path, be sure to include the path to the file (as in C:\WINAPPS\INTERNET\NETCOM\NETCRUZ.EXE.  You can enter up to 132 characters here if you need to.  The bottom section is the TOTAL TIME.  This value is the total time for this particular Connect.  If you want to change it, you can do so.  Use the format HH:MM:SS.

The [DELETE] button is used to delete the specified entry from the Connect list.  When you click this button, you will be asked to confirm that you want to delete the selected Connection.  If you click Yes, the connection will be removed from the list.

NOTE:  If you Delete a record from the list, keep in mind that any Script files you are using that are indexed into the list will have to be updated.  Deleting a record will cause all entries past it to move up 1 slot in the list box, so you will have to edit your script files and change the indexes.

If you have a program assigned to a connect, the LAUNCH button will be enabled.  Just click this button to start the program.  If a program is not assigned to this Connect, the button will be disabled.

The Pushbuttons on the right side of the dialog are: HELP to access this help file, ABOUT to display the About dialog, CONFIGURE to access the configuration options,  START / AUTO or STOP (depending on the configuration) to start the timer,  and EXIT to end the program.   There are also EDIT and LAUNCH buttons beneath the List Box. The Help, About, and Exit buttons are pretty self-explanatory, and the Configure button has its own section.   The Edit and Launch buttons were described above. The only one that still needs a little explanation is the Start button, because it may not say Start!

The Start button is used to start the timing function.  When Auto Detect Start is enabled in the configuration options, this button will be labelled Auto instead of start, and that is what requires a bit of explanation.  In Manual mode, when you press the Start button, the timer function starts, and the displays are updated each second.  In Auto mode, when you press the Start button (even though it is labelled Auto it is still actually a Start button!), normally nothing will happen.  This is because in Auto mode pressing the Start button causes the program to start watching the carrier detect line on your modem.  This is checked once per second, and when the program sees the CD line go high (at the beginning of a modem connection), the display starts updating.  As long as your modem is not connected to another modem, the timers are not updated.  When the CD line to your modem goes low (when the modem Hangs Up), the program will remain in Auto mode, but the timers will stop updating.  This is one of the great features of the program since it allows you to monitor the modem port, and not worry about remembering to start the timer each time you call someone.

Any time the program is in its timing function, the Connection list box will be disabled.  You cannot change the connection while the program is timing.  If you want to change to a different connection, you will have to Stop the timer (by pressing the Stop button), change the Connection, and Start the timer again.  You do NOT have to hang up your modem and call back if you were running in Auto mode.  Just click the Auto button to start the timer, and the program will immediately see that you are already connected to someone.

The two Reset buttons in each of the display sections can be used to reset the session and accumulated time.  If you click the reset button for the accumulated time, you will be prompted to verify that you really want to do this since it will clear the time in the initialization file also.  You can reset either of the time displays at any time, even when the timer is running.  If you decide in the middle of a connection that you want to reset the time, go right ahead and do it.

If you Minimize the program, it will be displayed as an Icon on your desktop.  The session will will still be displayed as the title of the icon.  This allows you to get the program out of your way, but still keep an eye on how long you have been connected.

There are a couple of ways to start and end the program.   It can be configured to start as an icon or a full-size display, or configured to start as an icon only if it is passed a command line parameter.  It can also be configured to exit when the carrier drops, or exit when the carrier drops but only if it was passed a command line parameter.  For more information on these options, see the Configuration section.


WHATS NEW FOR VERSION 2?

Version 2.1 adds several new features that really enhance the effectiveness of the program.

START MINIMIZED - This is a new configuration option that allows the program to start in a Minimized format as an Icon instead of the full-sized dialog.

START MINIMIZED ONLY IF A COMMAND LINE PARAMETER WAS PASSED - This option, used in conjunction with a script file, allows you to start the program in its full-sized mode of operation when it is started from a program group, and also start it as an Icon if it is started from a script file.

END PROGRAM WHEN CARRIER DROPS - This new option allows you to configure the program so that when the carrier to your modem drops, the program will automatically exit.

END PROGRAM WHEN CARRIER DROPS BUT ONLY IF PROGRAM WAS STARTED WITH A COMMAND LINE PARAMETER - This option is similar to the one above, but it allows you to configure the program so that it will exit when the carrier drops, but ONLY if the program was started with some command line parameter (it doesnt matter what parameter as long as something is passed!).  It also is very handy when used in a script file because it allows you to use a script to start the program (like you would with Trumpet Winsock), and when you end the communication, the program will automatically exit to.

DISPLAY SUMMARY - This option is enabled only if END PROGRAM WHEN CARRIER DROPS is enabled.  Since when the END PROGRAM WHEN CARRIER DROPS feature is enabled, when the carrier drops and the program ends, the display showing the session and total time will disappear.  If you enable this feature, a message box will be displayed showing the session and total time.

LAUNCH PROGRAM - This is similar to a Reverse Script.  Since so many programs don't allow you to launch another program, you can use this one to launch the other program.  For example, if you use a communications program such as Procomm or Qmodem.  You can configure THIS program so that when you select a Connection, you can click the Launch button to start your communications program.

NOTE:  The initialization file used in Version 1.0 has been changed, however you can still use the Version 1 file.  See the INI File Structure section for further information.


INI FILE STRUCTURE

The initialization file CCM20.INI is retained in the same directory as the program (as opposed to many Windows applications that put it in the Windows directory).  The structure of the file is very simple, and may be edited with any text editor, such as Noetpad, if required.  The format is as shown below in an example:

[GENERAL]

Port=3

Reset=1

Mode=1

NumEntries=4

Last=3

Version=2.0

Minimized=1

CDExit=1

CmdLineMin=1

CmdLineExit=1

TimerInt=100

[CONNECT]

Ent0=Nashville Exchange (Login),0,0

Ent1=Nashville Exchange (SLIP),0,0

Ent2=Netcom,0,1,C:\WINAPPS\INTERNET\NETCOM\NETCRUZ.EXE

Ent3=The Edge Group,0

GENERAL SECTION

PORT is the communications serial port from the configuration dialog.  It will be number from 1 to 4, corresponding to COM1 through COM4.

RESET is the Auto Reset setting from the configuration dialog. 1 is enabled, 0 is disabled. Default=Enabled.

MODE denotes the Manual or AutoStart mode.  0 is AutoStart, 1 is Manual. Default=Manual.

NUMENTRIES denotes the number of Connections displayed in the list box.

LAST denotes the last connection number used.  This value is relative to zero, or in other words, the first entry in the list box is 0, the second is 1, etc.  In the example above, LAST=3, so this would indicate the fourth entry in the list box.

VERSION denotes this file as a Version 2.0 file

MINIMIZED is the state of the Start Minimized button.  0 is Disabled, 1 is Enabled. Default=Enabled.

CMDLINEMIN is the state of the Start Minimized When Command Line Parameter Is Passed button.  0 is Disabled, 1 is Enabled.  Default=Enabled.

CDEXIT is the state of the Exit Program When Carrier Drops button.  0 is Disabled, 1 is Enabled.  Default=Enabled

CMDLINEEXIT is the state of the Exit Program When Carrier Drops But Only If A Command Line Parameter Was Passed button.  0 is Disabled, 1 is Enabled. Default=Enabled

TimerInt is the number of milliseconds between display updates.  It corresponds to the configuration dialogs Display Update Interval.  The default is 100 milliseconds.

CONNECT SECTION

ENT0 through ENT31.  These values are the actual Connection strings.  There must be a number of these equal to the value specified in NUMENTRIES.  They begin with number zero, for the first entry in the list box, and can go through 31 for a total of 32 entries.  The string is stored in as many as four parts with a comma dividing the parts.  Anything to the left of the first comma is taken as being the name of the connection (and you cannot have a comma in the name!).  The numeric value to the right of the first comma is the total number of connect seconds.  If it shows 60, you were connected to that person for 60 seconds (this will be shown on the display in minutes as 00:01:00.

Following the connect time is either a 0 or a 1.  If a 0 is present, there is no Launch Program associated with this connect.  If a 1 is present, there is a launch program, and the command to start it will follow (with another comma between the 1 and the program command).

NOTE:  This initialization file is different from the Version 1.0 INI file.  If you have Version 1.0 of this program, you can rename your CCM1.INI file to CCM20.INI and make one change for it to work properly.

After you rename the file, open it with NOTEPAD or a similar text editor.  At the bottom of the file, add a line that reads [CONNECT].  Then, move up in the file and find all of the Connect lines (they will start with Ent0, Ent1,Ent2, etc.) and MOVE them down below the [CONNECT] line that you just added.


Passing Command Line Parameters
COMMAND LINE PARAMETERS

You can pass the number of the connection to be used on the command line to automatically start the program with a particular connection selected in the list box.  This is particularly handy for use in Script files, as used with Trumpet Winsock or other communications software.  Simply follow the command to start the program with the list box index of the connection you want to use.  For example, it I wanted to start the program with Netcom selected, and Netcom was the third item in the list box, the command would be CCM20 3.

If anything is passed as a parameter to the program (even if it is an invalid value), AND if the program is configured for AutoStart mode, the program will automatically be started with the timer running.  This was done intentionally so that you could launch the program from within a script file (which will normally do all the dialing for you) without having to start the timer running yourself.  Remember that in AutoStart mode, the timers dont actually start changing value until a carrier to your modem is detected, so the time wont change until you are actually connected to the other modem.

If you use Script files to dial under Trumpet Winsock, you can edit the script command file to automatically start the program, and optionally select a particular connection.  Trumpet Winsocks Dialler menu (yes, it is misspelled) lists the script files in the same directory as TCPMAN.EXE.  Login is used as the default most of the time, but you may have others.  The Login script will be named LOGIN.CMD in the same directory as TCPMAN.EXE, and you can edit it with Notepad or a similar editor.

Lets say you have three accounts you use frequently, and have a Trumpet script set up for each of them.  Well call them Netcom, TNE, and Netstar.  You have this program set up so that Netcom is the second item in the list box, TNE SLIP is the first item in the list box, and NETSTAR is the third item in the list box.  Edit NETCOM.CMD, and at the end of the script file put the line EXEC CCM20.EXE 2 to start CCM20 running, and select the second list box item as the connection to be used.  Edit TNE.CMD, and at the end of the script add the line EXEC CCM20.EXE 1 to start the program with the first list box item selected.  Edit NETSTAR.CMD, and at the end of the script add the line EXEC CCM20.EXE 3 to start CCM20 with the third list box item selected.  This assumes that CCM20.EXE is in the same directory as TCPMAN.EXE.  If it isnt, include the complete path to the program as in EXEC C:\INTERNET\UTILS\CCM20.EXE 1.  Note in all cases the command line is enclosed in double-quotes.


Introduction To CCM20
INTRODUCTION

This program is a compact time monitor for use during communications sessions.  There are many very good examples of this type of program available as ShareWare or FreeWare, but all of them that I tried left something to be desired as far as my use goes.  This is not to say that they arent good, rather for what I do, I couldnt get them to do what I wanted.

My main gripes with most of the others I used were:

No multiple connections.  There was usually only one Connection allowed.  All time accumulated was posted to this account without being able to say I want this session posted to one account, and then change to another account for another session.  There are some programs available that allow multiple Connections, but most of them track cost whereas I was only interested in time.

Everybody is concerned with the cost of a session, and not the connect time of a session.  My Internet accounts are not Cost Based, they are Time Limited.  I have a certain amount of time each month (or day) that I can use, and all I want to know was how much TIME has been used during each session since it doesnt cost anything.

Many of the timer programs dont accumulate statistics.  In addition to the amount of time I spend connected, I wanted the total time accumulated for a certain period.  One of my accounts has a 2-hour per day limit, and another account has a 40-hour per month limit.  I wanted to be able to see the total accumulated time, and be able to quickly reset it.

No Automatic Start.  I wanted to be able to start the program, and let it decide when to start running based on my modem connection.

No Automatic Stop.  I wanted a way to automatically end the program automatically.  This one has that capability.  It can exit automatically in two different ways.  See  the Configuration and Whats New For Version 2 sections for further information.

No Control Over Minimized or Maximized Display.  Sometimes I want the full-size display, and sometimes I want a minimized display. This program offers you a choice in that it can be configured to start as an icon when launched from a script, and start full-sized when launched from a Program Group.

I could find lots of software that would do some of these things, but none that would do all, so I decided to write my own.  CCM21 is the result (CCM21 stands for Craig Communications Monitor Version 2.1 by the way).  Its main features are:

Multiple setups stored in one INI file.  You can have up to 32 connections stored.  Each is written into a single INI file that holds the name of the connection, and the total connect time.

The session ID can be passed on the command line.  This allows you to execute the program from within a Script file, and select the proper connection automatically.

Connect time is continually displayed and updated showing the current session time and the total accumulated time.

The session time and accumulated time can be reset by clicking one button.

Optional Automatic Start.  When enabled, the Automatic mode will watch the carrier detect line from your modem.  When the CD line goes high, at the beginning of a session, the timer starts.  When CD drops, the timer stops.

Optional Automatic Reset.  When enabled, the session time is automatically reset to zero each time a session is begun.  When disabled, the session time continues to accumulate, and is not reset to zero each time a session is begun.

Configurable for COM1 through COM4 (this is only pertinent in AutoStart mode.  In manual mode,  the serial port is unneeded).

Session time is displayed on the icon when the program is minimized.  If you have the program Minimized on your desktop, the time for the current session will still be displayed as the icon title.

Program Launch.  If you want to set up a program to be launched from this program (kind of like a Reverse script) you can do so.

CCM20 is FreeWare.  You may freely distribute the software pursuant to the restrictions set forth in the Copyright and Disclaimer section.  I hope you enjoy the software, and if you have any problems (or even if you dont!) please let me know.  My address is in the Problem Reports section.

This is not a real fancy program, nor is the help file highly detailed.  The program is so simple to use that it doesnt need a lot of help information.  All told, the software and help file took about 20 hours from idea to complete, and thats why Im not afraid to just give it away.  I love writing software, and get a lot of enjoyment from hearing from those who use it.  If you like it (or even if you dont), drop me an E-mail message and let me know.

Scott Craig	SCraig@IX.Netcom.Com

June, 1995	Scott.Craig@Nashville.Com


Problem Reports
PROBLEM REPORTS AND/OR REACHING THE AUTHOR

If you have a problem with this software and want to file a trouble report, or if you simply want to send me a note, I can be reached at the following addresses:

SCOTT CRAIG            	EMail to Scott.Craig@Nashville.Com

409 Jessie Drive	or SCraig@IX.Netcom.Com

Nashville, TN  37211-3534

Please include the version of the software that you are running (it is displayed at the top of the screen, and as much information as you can about the problem you are having (the steps required to cause the problem, what happens, etc.)

Be sure to include your return address.  This is a 1-man operation not a business, so time is limited, but I WILL answer all letters or EMail received.  I am very interested in my software, and try very hard to write the best software that I can.  If you have problems, I want to know about it.  If you DON'T have problems, or have ideas as to how the program could be made better, I want to know about that too.  I very much appreciate your thoughts and input, and would like to hear from you.

Thanks Very Much .... Scott


Copyright And Disclaimer
COPYRIGHT INFORMATION and DISCLAIMER

This software is owned and copyrighted by the author, and is released as FreeWare, and may be freely copied and distributed by any means pursuant to the following restrictions:

All programs, files, and sections remain intact and unmodified.

This software may NOT be distributed as part of Bundled software (including CD-ROM or diskette distribution of Shareware and/or Freeware software) for sale without the express written permission of the author.

No monetary reimbursement of any kind is received for the copying or distribution of the software.

In plain English, you can GIVE a copy to anybody you want to, but you cannot SELL a copy to anybody without my permission.

DISCLAIMER

This software is provided on an as-is basis.  Neither the author nor any distributor of this software offer any  warranty of any kind, nor accept responsibility for any  damages of any type incurred through or by the use of this software.  Through and by the use of this software, you accept all responsibility for any damages incurred or thought to be incurred by using this software.

This software and all associated files are:

COPYRIGHT, 1995, SCOTT CRAIG

ALL RIGHTS RESERVED


DOUBLE CLICK

To Double Click an item, position the mouse cursor on the desired item, and click the left mouse button TWICE in quick succession.


No Help Available

No help is available for this area of the window.


No Help Available

No help is available for this message box.