RAD Studio 10.4.1 is now available! Learn more. Looking for discounts? Visit our Special Offers page!
C++

Showing a splash screen at startup

Author: Embarcadero USA

 Question and Answer Database

FAQ533C.txt   Showing a splash screen at startup
Category   :VCL
Platform    :All
Product    :C++Builder  1.x

Question:

Where is the best place to open a splash screen on program
start up?

Answer:

The best place to open a splash screen is in the project
source file after initializing the Application object and
before running the Application object.
This is accomplished by creating a "splash" form on the fly
and then displaying it before the main loop of the app is
entered.  Just before calling Application->Run(), we hide
and delete the splash form.

//---------------------------------------------------------------------------
#include 
#pragma hdrstop
//---------------------------------------------------------------------------
USEFORM("Unit1.cpp", Form1);
USERES("Project1.res");
//---------------------------------------------------------------------------
// Be sure to include the header for the splash form.
// This splash form is called TSplashForm.
#include "Splash.h"
//---------------------------------------------------------------------------
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
    Application->Initialize();

    SplashForm = new TSplashForm(Application);
    SplashForm->Show();
    SplashForm->Update();

    Application->CreateForm(__classid(TForm1), &Form1);
    
    SplashForm->Hide();
    delete SplashForm;

    Application->Run();

    return 0;
}

7/2/98 10:32:32 AM
 

Article originally contributed by Borland Staff


Reduce development time and get to market faster with RAD Studio, Delphi, or C++Builder.
Design. Code. Compile. Deploy.
Start Free Trial   Upgrade Today

   Free Delphi Community Edition   Free C++Builder Community Edition

Related posts
C++DelphiTech Partner

Easily Download And Install A Robust Syntax Highlighter For Delphi And C++ Builder From GetIt

C++Delphi

Powerful Set Of 200+ VCL Components By DevExpress For Delphi Business Solutions

C++DelphiRAD Studio

Automate Excel and Word Directly From Delphi Using Office Component Suite

C++DelphiTech Partner

Set of utilities for Delphi and C++Builder to speed up your development process

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

IN THE ARTICLES