Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Splash screen!!!!

Status
Not open for further replies.

felixsoft

Programmer
Nov 8, 2001
15
0
0
US
how can i make a splash screen in Dev C++ 4.0
Everything on the net is for the god foresaken microsoft vc
Please help me out.
 
What is a splash screen, if not a form that closes after a certain amount of seconds.
I know that in borland you can add a timer, and when the timer launches the form close... My codes look like something a kid wrote
I have absolutely no idea what I am talking about
Somehow I still manage to make it work
 
All a splash screen is is a form with your graphics, etc., a time, and the borders and icon ususally turned off. I can tell you how to do this with Borland.

Is there not a Dev C++ forum here?
James P. Cottingham

I am the Unknown lead by the Unknowing.
I have done so much with so little
for so long that I am now qualified
to do anything with nothing.
 
Okay 2ffat. I also have Borland Turbo C++ 5.0. How can I make a splash screen in Borland C++? I am really poor with Win32 Programming.
 
Unfortuately, my instructions are for BCB (Borland C++ Builder). If you want those, I can post them.
James P. Cottingham

I am the Unknown lead by the Unknowing.
I have done so much with so little
for so long that I am now qualified
to do anything with nothing.
 
yes please post them. that would be great. If all else fails then i can make the compat w/ the others
 
OK, here goes. Remember this is for BCB.
1) After creating the main form, create a second form with its BorderIcons set to false, BorderStyle to bsDialog, FormStyle to fsStayOnTop, and Position to poScreenCenter.

2) Add whatever you want to the second form, bitmaps, text, etc.

3) Add a Timer control to the second form.

4) Create a OnTimer handler for the Timer control. Put the code
Code:
Close();
in the handler.

5) Now you will need to create a function that will remove the caption from the second form. You can do this by creating a function prototype in the second form's private user declarations and then adding the function itself. All this function will do is call the base class and the remove the caption.For example, if the function was defined as
Code:
void __fastcall CreateParams(TCreateParams &Params);
then the function would be
Code:
void __fastcall CreateParams(TCreateParams &Params)
{
  TForm::CreateParams(Params);
  Params.Style &= ~WS_CAPTION;
}

6) Finally, you need to call the form in the main form's WinMain function. In BCB, you put the following code in the try loop that is created for you. Put it after the
Code:
Application->Initialize();
call. If you named the second form Form2 the code would look like
Code:
Form2=new TForm2(Application);
Form2->Show();
Form2->Update;

By the way, these instructions came from Borland C++ Builder How-To by John Miano, Tom Cabanski, and Harold Howe. The latter's web site is . James P. Cottingham

I am the Unknown lead by the Unknowing.
I have done so much with so little
for so long that I am now qualified
to do anything with nothing.
 
I forgot one very important detail. On Form2's close, you need to free all resources. You can do this with
Code:
Action = caFree;
James P. Cottingham

I am the Unknown lead by the Unknowing.
I have done so much with so little
for so long that I am now qualified
to do anything with nothing.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top