unit Unit1;

interface

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

const
  UM_CONNECT = WM_USER + 1;

type
  TForm1 = class(TForm)
    StatusBar1: TStatusBar;
    lblConnections: TLabel;
    procedure FormCreate(Sender: TObject);
  private
    FConnections: Integer;
    procedure UpdateConnections;
    procedure UMConnect(var Msg: TMessage); message UM_CONNECT;
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

uses uCustomerServerModule;

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
  StatusBar1.SimplePanel := True;
  StatusBar1.SimpleText := 'Connected';
  Top := 5;
  Left:= 5;
end;

procedure TForm1.UMConnect(var Msg: TMessage);
begin
  FConnections := FConnections + Msg.WParam;
  UpdateConnections;
end;

procedure TForm1.UpdateConnections;
begin
  if FConnections = 1
  then lblConnections.Caption := '1 connection'
  else lblConnections.Caption := IntToStr(FConnections) + ' connections';
end;

end.
