Dec 052017
 
A debugging tool for Windows programmers w/source code & examples.
File WINMON20.ZIP from The Programmer’s Corner in
Category Recently Uploaded Files
A debugging tool for Windows programmers w/source code & examples.
File Name File Size Zip Size Zip Type
INCLUDE 0 0 stored
PRIVATE.H 2140 1026 deflated
WINMON.BAS 1563 376 deflated
WINMON.H 1077 413 deflated
WINMON.PAS 3904 776 deflated
TESTMON.ZIP 129696 128398 deflated
WINMON.DLL 20480 10358 deflated
WINMON.WRI 29696 9589 deflated
WINMONEX.EXE 48128 19011 deflated

Download File WINMON20.ZIP Here

Contents of the WINMON.WRI file


1S=/2!89- -












WinMon
Version 2.0
A debugging tool for Windows programmers!


Copyright 1993, 1994, 1995 David Burki
All Rights Reserved.

Introduction

WinMon is a facility which allows Windows programmers to display debugging information in a separate application's list box. The API to display information uses the same variable argument list format as the standard C printf() function. For Visual Basic and Delphi developers, version 2.0 has added specific functions to display string, unsigned integer, long integer and floating point data. The set of APIs allow the behavior of the list to be controlled by the application being debugged. WinMon consists of 2 parts; a DLL which provides the cross application communications link, and an application which controls the behavior list box.

Tracing through your Windows application with a debugger can be a tedious task. Using message boxes to display text is OK, but hitting Enter over and over quickly becomes tiresome. There are times that printf() output would be the ideal method to debug your code. This is where WinMon comes to the rescue. WinMon allows you to send text to an independent application window without stopping (or slowing very much) your applications execution. Information sent to WinMon is kept in a list box so you can browse the data later, or the data can be written to an ASCII text file to archive.

WinMon Features:

- Format and send text using printf() style variable argument lists.
- Non C type functions to write integers, longs, floats and strings.
- Debug style hex/ASCII dump of memory.
- Automatically save the list contents to a file after n insertions.
- Text in the list box can be written (append or overwrite) to a file.
- Insertion of text can be paused and restarted.
- The contents of the list can be cleared.
- A time stamp can be inserted into each string.
- The WinMon list box can be made to stay-on-top of all other windows.
- Save and restore options between sessions (Registered version only).

All these features can be controlled from the menu of WinMonEx, or through the API.

Packing List:

WinMonEx.EXEThe stand-alone application which receives the text strings. It also provides a menu interface to the API functions.
WinMon.DLLThe DLL required by WinMon.EXE and your application. The DLL is the link between your application and WinMonEx.EXE.
WinMon.LIBThe import library for WinMon DLL API functions. Required only if the DLL is implicitly linked.
WinMon.HC header file containing the function prototypes for the API.
WinMon.PASA Pascal unit (Borland's Delphi) for inclusion in your project.
WinMon.BASA Visual Basic module for inclusion in your project.
WinMon.WRIThe WinMon User's Guide in Windows Write format.
TestMon.*A sample Windows applications demonstrating the use of WinMon. Examples are provided in C, Visual Basic and Delphi.
Legal Notices

This version of WinMon is NOT public domain or free software, but is being distributed as Shareware. WinMon is owned by and remains the property of David Burki, and is protected by international copyright agreements.

Non-registered users of this software are granted a limited license to make an evaluation copy a for 30 day trial use period on a private, non-commercial basis, for the express purpose of determining whether WinMon is suitable for their needs. At the end of this trial period, you should either register your copy or discontinue using WinMon.

All users are granted a limited license to copy WinMon for the trial use of others, subject to the above limitations. This license does NOT include distribution or copying of this software package:
In connection with any other product or service.
For general use within a company or institution.
Distribution in modified form, i.e., the file containing this license information MUST be included, along with all files specified in the Packing List.

Operators of electronic bulletin board systems (Sysops) are encouraged to post WinMon for downloading by their users, as long as the above conditions are met.

DISCLAIMER AND WARRANTY: WinMon IS PROVIDED "AS-IS" WITHOUT WARRANTY OF ANY KIND. THE AUTHOR MAKES NO REPRESENTATION OR WARRANTY, EITHER EXPRESSLY OR IMPLIED WITH RESPECT TO THIS SOFTWARE PRODUCT, INCLUDING THE QUALITY, PERFORMANCE, MERCHANTIBILITY OR FITNESS FOR A PARTICULAR PURPOSE. IF YOU RECEIVED THIS SOFTWARE DIRECTLY FROM THE AUTHOR, THE AUTHOR'S ENTIRE LIABILITY AND YOUR EXCLUSIVE REMEDY SHALL BE THE REPLACEMENT OF THE MEDIUM THAT HOLDS THE LICENSED SOFTWARE SHOULD THE MEDIUM BE UNREADABLE. NEITHER THE AUTHOR NOR ANYONE ASSOCIATED WITH THE AUTHOR SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, CONSEQUENTIAL OR INCIDENTAL DAMAGES THAT MAY ARISE OUT OF THE USE OF THIS SOFTWARE PRODUCT OR PORTIONS OF THIS SOFTWARE PRODUCT. THESE ARE THE ONLY WARRANTIES THAT ARE MADE BY THE AUTHOR ON THIS PRODUCT.
Installation and use

Unregistered Version
To install WinMon, create a directory for WinMon, change to that directory and unzip the shareware zip file. Modify the PATH statement to include the new directory or copy WinMon.DLL to a subdirectory which is included in the PATH.

The sample applications in C, Visual Basic and Delphi are contained in the zipfile TestMon.ZIP which is contained in the shareware zip file. Unzip TestMon.Zip using the -d option of PK Zip to create the Testmon directory and its subdirectories.

Registered Version
The disk containing the registered version of WinMon contains a zip file. This zip file was produced using the -r and -p options of PK Zip which preserve the original directory structure. The original directory structure can be reproduced using the -d option of PK UnZip from a base directory on your drive. The original directory structure is:
\WinMon
\Exe(WinMonEx related files)
\DLL(WinMon.Dll related files)
\TestMon
\C(examples of use in C)
\VB(examples of use in Visual Basic)
\Delphi (examples of use in Delphi)
\Include(include files shared among source modules i.e. .H, .BAS & .PAS)


C
Copy WinMon.H to a directory which is in the INCLUDE path and copy WinMon.LIB to a directory included in the LIB path for your C compiler. Place the desired WinMon function calls in your source (remember to #include winmon.h) and compile your source. The WinMon DLL can be explicitly linked using LoadModule() or LoadLibrary(), or implicitly linked by including WinMon.LIB in the library list of the link command for your application.

Visual Basic
Add WinMon.BAS to your project or include the declarations in one of your common .BAS files.

Delphi
Add WinMon.PAS to your project.
Using WinMon

Note: WINMON_iMsg() is only callable from languages which support the C calling convention and allow variable argument lists. Other languages must use the specific functions supporting the data type to be displayed. ALL POINTERS ARE ASSUMED TO BE FAR POINTERS!

The following API definitions and examples are in C. For Visual Basic and Pascal, refer to the source modules WinMon.BAS and WinMon.PAS for declarations.


WINMON_iMsg

int WINMON_iMsg( LPSTR, ... )
LPSTR lpszFmtStr;/* far pointer to the format string */
.../* arguments to be substituted */

WINMON_iMsg() has the same argument format as the standard C printf() function. The first parameter is a far pointer to a format string. See documentation on the C runtime library functions of the printf() family for further details.

Returns: The length of the output string inserted in the list. This includes substitutions and time stamp if in effect.

NOTE: Programs compiled in the small or medium memory models must cast pointer parameters as far pointers. The compiler can properly cast the format string, since it is declared in the function prototype, however the compiler can not properly cast pointers in the variable argument list.

int iRetVal;

case WM_COMMAND:
iRetVal =
WINMON_iMsg( "WM_COMMAND received. wParam = %d lParam =%ld", wParam, lParam );
.
.
.
break;



WINMON_vClear

VOID WINMON_vClear( VOID );

WINMON_vClear() deletes all list items in the WinMonEx list box. Your application can use this function to clear the list at any time. This function has the same effect as selecting Clear from the WinMonEx Options menu.


WINMON_bPause

BOOL WINMON_bPause( BOOL );
BOOL bOnOff;/* TRUE = pause, FALSE = resume */

WINMON_bPause() allows the application to suspend insertion of text sent to the WinMon list. Passing TRUE causes WinMon to suspend insertion. Passing FALSE causes WinMon to resume
insertion. If WinMon is already in the same state as the state requested, no action is taken. This function has the same effect as selecting Pause from the WinMonEx Options/Settings dialog.

Returns: The current pause state is returned.

NOTE: TRUE is defined as any non-zero value. FALSE is defined as zero.


WINMON_bTimeStamp

BOOL WINMON_bTimeStamp( BOOL );
BOOL bOnOff;/* TRUE = time stamp, FALSE = no time stamp */

WINMON_bTimeStamp() allows the application to cause WinMon to begin or end adding a time stamp to every string inserted in the list box. When time stamping is turned on, every string inserted in the list box is prepended with the time (HH:MM:SS). Requesting a time stamping state which is already in effect produces no action. This function has the same effect as selecting Time Stamp from the WinMonEx Options/Settings dialog.

Returns: The current state is returned.

NOTE: TRUE is defined as any non-zero value. FALSE is defined as zero.


WINMON_bFileSave

BOOL WINMON_bFileSave( LPSTR lpszFileSpec, BOOL bOverwrite );
LPSTR lpszFileSpec;/* filename to write */
BOOL bOverwrite;/* True = Overwrite existing, FALSE = Append existing */

WINMON_bFileSave() allows the application to write the contents of the WinMon list box to a file. The list contents are written to the file specified by lpszFileSpec. The bOverwrite parameter controls whether the list is appended to the end of an existing file, or the existing file is truncated before the list contents are written. The contents of the list are not affected. This function is not available on the WinMonEx Options/Settings dialog.

Returns: Boolean value indicating success (TRUE) or failure (FALSE).

NOTE: TRUE is defined as any non-zero value. FALSE is defined as zero.

#include

BOOL bRetVal;
/* write the contents */
bRetVal = WINMON_bFileSave( "c:\\tmp\\winmon.sav", TRUE );
/* if successful, clear list */
if ( bRetVal )
WINMON_vClear();


WINMON_bOverWrite

BOOL WINMON_bOverWrite( BOOL bDesiredState );
BOOL bDesiredState;/* TRUE = Overwrite on file save, FALSE = Append on file save*/

WINMON_bOverWrite() sets the overwrite/append flag used during autosave. This flag is only used during autosave. This function has the same effect as selecting Overwrite on AutoSave from the WinMonEx Options/Settings dialog.

Returns: The current state is returned if successful ( i.e. the state requested in bDesiredState) or -1 if the function was unable to set the desired state.


WINMON_SetFileName

const LPSZ WINMON_SetFileName( LPSZ lpszFileName );
LPSZ lpszFileName;/* fully qualified file name to set */

WINMON_SetFileName() is used to set the name of the autosave file. The autosave file name is used in conjunction with the autosave count to automatically write the entire contents of the list to a disk file. The parameter, pszFileName, should be a fully qualified file specification. No checking is done to insure the name is a valid file name or that the drive/directory exists. This function has the same effect as entering a fully qualified filespec in the Auto Save File Name edit field on the WinMonEx Options/Settings dialog.

Returns: A far pointer to the file name which WinMon will use during autosave or the NULL pointer if set failed. The pointer returned by this function points only to a copy of the save file name, not the actual name use by WinMon..


WINMON_SetAutoSaveCount

UINT WINMON_SetAutoSaveCount( UINT uCount )
UINT uCount;/* number of items to insert in th list before autosave is done */

WINMON_SetAutoSaveCount() is used to set the number of items inserted into the list before an autosave is performed. If uCount is zero, the autosave feature is disabled. This function has the same effect as entering a number in the Auto Save Count edit field on the WinMonEx Options/Settings dialog.

Returns: The current value used to determine the autosave count.


WINMON_WriteLnString

int WINMON_WriteLnString( LPSTR lpszFormatString, LPSTR lpszInsertStr );
LPSTR lpszFormatString;/* far pointer to a C printf() style format string */
LPSTR lpszInsertStr;/* far pointer to the ASCIIZ string to insert */

WINMON_WriteLnString() is a non-C style entry point to WINMON_iMsg(). This function is used to format and print a string argument. The first parameter is a far pointer to a printf() style format string. The format string can contain arbitrary text to accompany the string variable. The string variable is inserted into the format string in place of the %s place holder imbedded in the format string. If the format string is "The value of pszStringVar is %s in function GetName()" and the value of pszStringVar is "Jones", then the resulting entry inserted in the list would be "The value of pszStringVar is Jones in function GetName()". The %s place holder is replaced by the string pointed to by lpszInsertStr. The place holder must be %s. Delphi developers should note that both the format string and the insert string are of type PCHAR.

Returns: The length of the output string inserted in the list. This includes substitutions and time stamp if in effect.


WINMON_WriteLnUInt

int WINMON_WriteLnUInt( LPSTR lpszFormatString, UINT uIntVat );
LPSTR lpszFormatString;/* far pointer to a C printf() style format string */
UINT uIntVar;/* unsigned integer to insert */

WINMON_WriteLnUInt() is a non-C style entry point to WINMON_iMsg(). This function is used to format and print an unsigned integer argument. The first parameter is a far pointer to a printf() style format string. The format string can contain arbitrary text to accompany the unsigned integer variable. The unsigned integer variable is inserted into the format string in place of the %u place holder imbedded in the format string. If the format string is "The value of uIntVar is [%u] in function GetNum()" and the value of uIntVar is 25, then the resulting entry inserted in the list would be "The value of uIntVar is [25] in function GetNum()". The %u place holder is replaced by the value of uIntVar. The place holder may be any of the valid printf() place holders for integer variables; %u (unsigned integer), %d (signed integer), %x (hex output), %o (octal output). Delphi developers should note that the format string is of type PCHAR.

Returns: The length of the output string inserted in the list. This includes substitutions and time stamp if in effect.



WINMON_WriteLnDouble

int WINMON_WriteLnDouble( LPSTR lpszFormatString, double dDoubleVar );
LPSTR lpszFormatString;/* far pointer to a C printf() style format string */
double dDoubleVar;/* double floating point value to insert */

WINMON_WriteLnDouble() is a non-C style entry point to WINMON_iMsg(). This function is used to format and print a double precision floating point argument. The first parameter is a far pointer to a printf() style format string. The format string can contain arbitrary text to accompany the floating point variable. The double precision floating point variable is inserted into the format string in place of the %f place holder imbedded in the format string. If the format string is "The value of dDoubleVar is [%f] in function GetReal()" and the value of dDoubleVar is 3.1415, then the resulting entry inserted in the list would be "The value of dDoubleVar is [3.1415] in function GetReal()". The %f place holder is replaced by the value of dDoubleVar. Delphi developers should note that the format string is of type PCHAR.

Returns: The length of the output string inserted in the list. This includes substitutions and time stamp if in effect.


WINMON_DumpPointer

VOID WINMON_DumpPointer( LPBYTE lpbBuffer, WORD wBufSize );
LPBYTE lpbBuffer;/* far pointer to buffer to dump */
WORD wBuffSize;/* number of bytes to dump */

WINMON_DumpPointer() produces a debug style dump of lpbBuffer in the listbox. Each line of the dump produced will appear as individual items in the list.

Note: Before attempting to process the buffer, WinMon validates the readability of the entire buffer (i.e. each byte from lpbBuffer to wBufSize -1). If this check fails, an item is inserted into the list so stating and no other action is taken to process the buffer.

Returns: Nothing


WinMonEx Menu Items

File
Save...Presents the standard file save dialog, allowing the contents of the list to be written to a file.
ExitTerminates WinMonEx. Applications may continue sending text to WinMonEx, but the messages are ignored.

Options
Settings...Presents the Settings dialog
ClearEmpties the list box.

About
Presents the About dialog.

Settings Dialog

Stay on TopSets/Clears the stay on top attribute of WinMonEx. When set, WinMonEx "floats" above other windows on the desktop, but does not receive focus.
PauseSuspend/resume insertion of text.
Time StampSuspend/resume time stamping of inserted text.
Overwrite on AutoSaveWhen checked, autosave will truncate the existing autosave file before performing the autosave. When unchecked, the list contents are appended to any existing autosave file.
Clear after AutoSaveWhen checked, the list contents will be deleted after the autosave is performed. When unchecked, on action is taken with the contents of the list.
Save Settings on ExitWhen checked, the state of WinMonEx is saved in the WinMon.INI file. The value of all the options on the Settings Dialog as well as the window size and position are preserved and restored the next time WinMonEx is started. NOTE: This option is only available with the registered version.


Sample Application

TestMon Applications

Examples are provided in C, Visual Basic and Borland Delphi
The TestMon projects demonstrate most of the WinMon API. Note that the WINMON_iMsg() calls that pass arguments which are pointers explicitly cast the pointers as far. Failing to cast pointers as far results in a GP fault.

Evaluation and Registration

WinMon is a commercial software package. It is not free, and it is not in the public domain. WinMon is distributed as Shareware, which means that before you pay for the package, you may evaluate it to see if you want to continue using it. You may use WinMon free for a trial period of up to 30 days. If, after the trail period, you wish to continue using WinMon, you must pay a registration fee. If you choose not to pay the registration fee, you must stop using WinMon and remove it from your computer, although you are still free to keep copies and pass them along to others.

When you register, you will receive both the source and executables for the latest version of WinMon. Registered versions of WinMon include the convenience of being able to save and restore WinMon's position, size and all the attributes available on the Settings dialog. The registration fee is $15.00. The following registration form is provided for your convenience.

WinMon Registration Form

Name: ______________________________________________________________
Mailing Address: _____________________________________________________
City: _______________________________________________________________
State: _________________________Zip: ____________________________

Optional:
Work Phone: ( )_________________ Home Phone: ( )_______________

WinMon - Registered Package including C source $15.00
Disk size (check one):
3.5" ____
5.25" ____
Shipping via US Postal Service:
US and Canada:$2.00
Outside US and Canada:$3.50____________
Total:____________

Make checks and money orders payable to David Burki. All checks and money orders must be US funds drawn on US Accounts. Instruments drawn on non-US accounts will be returned and the order will not be filled.

Send all items to:David Burki
WinMon Registration
6039 W 157th PL
Shawnee Mission, KS 66223

Problem Reporting

Please direct correspondence concerning any problems, suggestions, or general comments to:
David Burki
6039 W 157th PL
Shawnee Mission, KS 66223

or email:
Internet:[email protected]
CompuServe:74206,102

All correspondence from registered users will be acknowledged if requested. Correspondence from non-registered users will be answered as time permits.


All trademarks are property of their respective owners.

xspkgc`]!Z#V2QN @xDuIqnkBhJeb_-\8YVS
x)sEpHmj~fb^ZVSNx/sp'k)fc^u[}XUROx]uipmhe`]
YVSPxuDrQolifa^[3X;UR
xur
ojgc_[~ W T Q
xh!ui!pm!m!j!g!d!a!^"[;#[email protected]#US#R
S#c#xo#uw#r#o#l#i$fe$cx$`%]%Z%W&T
&&x&uC&rH&o&l&ic'fu'c'`(](Z(W)T
))x+)u3)rt)oy)l)i*e*b++_>+\+Y+V+S
+,x,u,r,o,l,i,f=-cS-` .]+.Z/W"/T
"/>/xN/uZ/rb/oI0l`0ib0f0c0`_1]e1Z1W1T
11x
2u2r2o2l!2iZ2f`2cv2`2]2Z]3Ws3T
s33x3u4r4o4l4i5f5c>6`B6]F6ZH6W6T
66x+7u-7r/7mD7j7g7d
8a!8^B8[O8X8U8R
89x9u:r:o:l;i*;f,;cA;`C;]V;ZX;Wg;T
g;i;x;u;r?~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