{-----------------------------------------------------------------------------
The contents of this file are subject to the Mozilla Public License
Version 1.1 (the "License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/MPL-1.1.html

Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either expressed or implied. See the License for
the specific language governing rights and limitations under the License.

You may retrieve the latest version of this file at the FBA Creator Home Page,
located at http://www.fbacreator.com

Known Issues:
-----------------------------------------------------------------------------}
unit Unit11;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, jpeg, ExtCtrls, Unit3;

type
  TFrmStartup = class(TForm)
    Image1: TImage;
    trigger: TTimer;
    procedure triggerTimer(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FrmStartup: TFrmStartup;

implementation

uses Unit1;

{$R *.dfm}

procedure TFrmStartup.triggerTimer(Sender: TObject);

begin
  trigger.Enabled := false;
  Application.CreateForm(TMainForm, MainForm);
  self.Close;
  Application.Run;
end;

procedure TFrmStartup.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  Action := caFree;
end;

procedure TFrmStartup.FormCreate(Sender: TObject);
begin

  // inizializza la DLL
  if InitDLL(FPath(ExtractFilePath(Application.ExeName))) = false then begin
    ShowMessage(Unable_To_Load_Library_DLL);
    Halt;
    exit;
  end;

  // abilita timer trigger
  trigger.Enabled := false;
end;

end.
