Create own Splashscreen Delphi 10 seattle

  

Instead of using the png images through the project options for a splashscreen I want to use my own Form for a splashscreen.

I’ve found a solution for XE2 in the following link, but it doesn’t work for Delphi 10 Seattle: http://stackoverflow.com/a/9080804/2728408

Below I have some examples I’ve tried in my project .dpr:

Example 1:

program Project2;

uses
FMX.Forms,
System.SysUtils,
Unit1 in ‘Unit1.pas’ {MainForm},
Unit2 in ‘Unit2.pas’ {SplashForm};

{$R *.res}

begin
Application.Initialize;
SplashForm := TSplashForm.Create(nil);
SplashForm.Show;
Application.ProcessMessages;
Sleep(1000); // Whatever to control display time of splash screen

Application.CreateForm(TMainForm, MainForm);
SplashForm.Close;
SplashForm.Free;
Application.Run;
end.

Example 2:

program Project2;

uses
FMX.Forms,
System.SysUtils,
Unit1 in ‘Unit1.pas’ {MainForm},
Unit2 in ‘Unit2.pas’ {SplashForm};

{$R *.res}

begin
Application.Initialize;
Application.CreateForm(TSplashForm, SplashForm);
Application.Run;
Sleep(1000);
Application.Terminate;// Also tried Application.Destroy
Application.Initialize;
Application.CreateForm(TMainForm, MainForm);
Application.Run;
end.

Example 3:

program Project2;

uses
FMX.Forms,
System.SysUtils,
Unit1 in ‘Unit1.pas’ {MainForm},
Unit2 in ‘Unit2.pas’ {SplashForm};

{$R *.res}

begin
Application.Initialize;
Application.CreateForm(TSplashForm, SplashForm);
Application.Run;
Sleep(1000);
Application.CreateForm(TMainForm, MainForm);
SplashForm.Close;
Application.ProcessMessages;
Application.Run;
end.

Anyone has a solution to my problem?

Comments are closed.