program SplashTest;
{$mode objfpc}{$H+}
uses
{$IFDEF UNIX}
{$IFDEF UseCThreads}
cthreads,
{$ENDIF}
{$ENDIF}
{$IFDEF Windows}
Windows,
{$ENDIF}
Interfaces, // this includes the LCL widgetset
LCLType, Forms,
FrmMain, // <====== this is our MAIN Form
FrmSplash; // <====== this is splash form unit with "FormStyle = fsSplash"
{$R *.res}
var
fSplash: TFormSplash;
begin
RequireDerivedFormResource := True;
Application.Title:='Splash Demo';
Application.Scaled:=True;
Application.Initialize;
fSplash := TFormSplash.Create(Application); //Show a splash screen
fSplash.Show;
fSplash.Update;
Application.ProcessMessages;
Application.CreateForm(TFormMain, FormMain); // Create our main form and initialize any thing that is needed
{do some initialization here}
fSplash.Close; // close splash screen after everything is ready
fSplash.Release;
Application.Run;
end.