unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    AHMAppManager1: TAHMAppManager;
    Label7: TLabel;
    Label8: TLabel;
    procedure FormCreate(Sender: TObject);
    procedure AHMAppManager1NewInstance(Sender: TObject;
      NoOfInstances: Integer);
    procedure AHMAppManager1MaxInstance(Sender: TObject;
      NoOfInstances: Integer);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.FormCreate(Sender: TObject);
begin
  Label4.Caption:=Application.ExeName;
end;

procedure TForm1.AHMAppManager1NewInstance(Sender: TObject;
  NoOfInstances: Integer);
begin
 Label7.Caption:='This is Instance number  : '+InttoStr(NoOfInstances);
end;

procedure TForm1.AHMAppManager1MaxInstance(Sender: TObject;
  NoOfInstances: Integer);
begin
 Showmessage('This Application can not exist more than twice ! Restoring old Instance and quitting this Instance');
end;

end.
