mgLights for Delphi and Windows 95 Ver1.01

--------------------------------------------------------------

Disclaimer of Warranty

THIS SOFTWARE AND THE ACCOMPANYING FILES ARE "AS IS" AND 
WITHOUT WARRANTIES AS TO PERFORMANCE OR MERCHANTABILITY OR ANY 
OTHER WARRANTIES WHETHER EXPRESSED OR IMPLIED.  

The user must assume the entire risk of using the program.  

ANY LIABILITY OF THE AUTHOR WILL BE LIMITED EXCLUSIVELY TO 
PRODUCT REPLACEMENT. 


--------------------------------------------------------------

Freeware

This program is freeware.
--------------------------------------------------------------

Sourcecode

If you need the source code of mgLights :

The source code of mgLights is available. 
Please send US$ 10 or sFr.15.- to:

Michael Gasser, Quellenweg 3, CH 3084 Wabern.
Delivery of the source code ONLY BY eMail.

Contact :
If you like or dislike mgLights, then please send a message to :
Contact : theiler.gasser@bluewin.ch

--------------------------------------------------------------
Thanks to :

Dominique Pfister, who helped me a lot creating this component.
--------------------------------------------------------------




What is mgLights ?

With mgLights for Delphi, it's very easy to write your own 
modem performance monitor "Lights.exe".
"Lights.exe" is the Microsoft Windows 95 program, that always starts, 
when you set up a connection with your modem. 

--------------------------------------------------------------

public :

ModemName    : string 			Name of the modem
Status       : longbool 		Shows if every thing is doing well...
Baudrate     : integer 			Baudrate
BytesSent    : integer 			Bytes sent from the bgeinning of the 
						connection until now.
BytesReceived: integer 			Bytes received from the beginning of
						the connection until now.


DidSend      : integer 			Bytes sent since the last time the 
OnTimer event occurred.		
DidReceive   : integer  		Bytes received since the last time 
						the OnTimer event occurred.


published :

TimerInterval   : integer      	Sets the interval for the OnTimer
						event.
OnTimer         : TNotifyEvent 	

OnLightsEnd     : TNotifyEvent 	Modem connection has finished.


--------------------------------------------------------------
 
Example :

(0)
Install mgLights. ( I may be a good programmer, but I am certainly not a good artist, so, if you have a better icon for the component Tlights, I would be glad.... )

(1)
Put TLights ( you find it in the Internet components ) on a new form.

(2)
Put two labels (label1, label2) on the new form.

(3)
Assign to the events OnTimer and OnLightsEnd the following code ( marked red ).

(4)
Name your project "lights". 
Compile your source code.

(5)
Go to the directory \windows\system.
Search for the file lights.exe. 
Copy this file into another directory.

(6)
Copy your lights.exe into the \windows\system directory.

(7)
Set up a connection with your modem.

(8)
Lights.exe will automatically start, when the connection is set up.

(9)
Copy back the microsoft lights.exe into the \windows\system 
directory and begin to write your own cool lights.exe!


--------------------------------------------------------------

Example :


unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, mgLights;

type
  TForm1 = class(TForm)
    Lights1: TLights;
    Label1: TLabel;
    Label2: TLabel;
    procedure Lights1LightsEnd(Sender: TObject);
    procedure Lights1Timer(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.Lights1LightsEnd(Sender: TObject);
begin
     // The microsoft Lights.exe terminates after the modem connection
     // was terminated. So let's do the same in this simple example.
     Form1.Close;     	
end;

procedure TForm1.Lights1Timer(Sender: TObject);
begin
     Label1.Caption := 'Sent : '     + inttostr(Lights1.BytesSent);
     Label2.Caption := 'Received : ' + inttostr(Lights1.BytesReceived);
     Form1.Caption  := Lights1.ModemName;	
end;

end.



