Topic: Splashscreen

Good Morning Dmitry, all at MVD,

I have a Welcome / Splashscreen that I show when my project starts. 
The splashscreen stays visible until the user either uses the keyboard or moves the mouse at which point the splashscreen disappears.
When I run this WITHIN the MVD environment, it works as intended (see dmitry splashscreen.jpg) in the attached .zip file.
But when I run it as a standalone executable (requisitions.exe), the splashscreen immediately disappears.
Do you know how I can correct this?
Thanks,
Derek.

Post's attachments

Attachment icon requisitions dmitry.zip 686.21 kb, 545 downloads since 2015-04-03 

Re: Splashscreen

Hello Derek

I use frequently splash screen when I launch my applications (standalone, out from MVD environment).

For this i use a Timer.

Here is a snippet of my code :

On opening my application, a splash screen is shown during 5 secondes  (5000 = 5 sec) then it  escapes to give hand to the user for the application.

    Timer          := TTimer.Create(nil);             // create timer
    Timer.OnTimer  := @OnTimer;               // event procedure
    Timer.Interval := 5000;                            // 5 sec
    Timer.Enabled  := True;                         // Start timer
    Form1_Splash.ShowModal;                // Show welcome screen

It is not really orthodox, but it works fine for me.

I put this code between Begin ... END. at the end of the script.

JB

Re: Splashscreen

Re-Hello Derek

I forget an important thing.

When the splash screen gets away, you have to free The timer by this procedure (when 5 seconds are out) .

procedure OnTimer (Sender: TObject);
begin
     Timer.Enabled := False;        / / Timer is deactived
     Form1_Splash.Close;         // The splash screen is closed
     Grille.Show;                           // First (main) form of the application appears
     Timer.Free;                           //  we release Timer   (not to use ressources)
end;

JB

Re: Splashscreen

derek
You used event MouseMove which occurs right after start app, because your cursor is over the form.
Try to use event OnClick, then splash screen hides when user click on it.

Dmitry.

Re: Splashscreen

Hi Dmitry,
Thanks, i've changed it as you advised.
But it still surprises me that it works okay within the MVD environment but not when run as a standalone exe.
Derek.

Re: Splashscreen

Hello Jean,
Thanks for your suggestion.  It doesn't matter to me if it's unorthodox providing it works!!
I was just hoping for a really easy way of having the splash screen wait until the user actually 'started working'.
But it's 99% how i wanted now so it's okay (nothing is ever 100% - ha ha!).
Derek.

Re: Splashscreen

Hello Derek

Nothing prevents combine the method of Dmitry and mine.

JB