Click here to Skip to main content
Click here to Skip to main content

Splash screen with contents of the <b>VERSIONINFO</b>

, 24 Apr 2004
Rate this:
Please Sign up or sign in to vote.
Easy to implement splash screen for dialog based applications that displays the contents of VERSIONINFO. Look at this!

Sample Image - CSplashWnd_Extended.gif

Credits

This Splash screen is a composite:

  • CSplashWnd comes from CODEJOCK Software
  • CModuleVersion comes from Paul DiLascia / Microsoft Systems Journal 1998

Both of the above classes are edited (more or less) to suit my needs.

Introduction

With one simple call to a static function, you are able to show a Splash screen in your Dialog based application. The Splash screen gets its information out of the VERSIONINFO which is filled in by you.

Using the code

If you're not already finished with it, fill in the VERSIONINFO of your resources:

  1. Add:
    #include "SplashWnd.h"
  2. Add the virtual function PreTranslateMessage(MSG* pMsg) to your Main Dialog class and paste the following code to the function body:
    // Route messages to the splash screen while it is visible
    if(CSplashWnd::PreTranslateAppMessage(pMsg))
        {
            return TRUE;
        }
  3. Next,
    • 3.1. Call the static function
      SetInfo(BOOL bCompanyName, BOOL bCopyright, 
              BOOL bFileVersion, BOOL bProductName);

      in the OnInitDialog part of your Main Dialog class. The BOOLs tell the next function which of the four VERSIONINFOs should be used! In case you want to display all of the above mentioned information, just don't use this function.

    • 3.2 Call the static function
      CSplashWnd::ShowSplashScreen(UINT uTimeOut, 
                  UINT uBitmapID, CWnd* pParentWnd = NULL)

      in the OnInitDialog part of your Main Dialog class.

      • uTimeOut is the amount of time in milliseconds to display the Splash screen (if no other action occurs).
      • uBitmapID is the ID of the bitmap to display.
      • pParentWnd is the Parent window.

    Updated/added 28.04.2004:

  4. If you want to close the SplashScreen for whatever reason you have, call the static member.
    CSplashWnd::CloseSplashScreen()

    e.g.: call the function right before the end of OnInitDialog part of your Main Dialog class.

    That's all there is to do. If you want to change the text color, give the member COLORREF m_crTextCol of class CSplashWnd another value.

Some infos

I don't like messing around with image-editors, so I had the idea to display the version information which is already there. After some hours attempting to get the version information out of an executable, I looked in the Internet and found Paul DiLascia's very, very useful class. Then I used CODEJOCK's class and built support to display a Bitmap as background, stretch it if necessary (depends on the length of the information), and bring it all on the Bitmap.

It's like everything else. This class can be better, faster and maybe makes coffee. So feel free to change or add functions. Use this as a base for your own Splash screen or whatever.......

Have Phun! Wink | ;-)

History

  • Last update: 28.04.2004

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Thomas Latuske
Web Developer
Germany Germany
My name is Thomas, I'm born on January the 11th in
1970, right now I'm working in the Quality department
of a big Pipe mill as a Technician.
My hobbies are my girl friend, my car, RC-Planes and
Computers. I begun with VC++ some time ago and now
Programming is like a drug to me (I'm still a
beginner). I want to learn it all in a blink of an
eye Wink | ;-) but i know that this is not possible. It's
real fun for me and I do small Programms for my own
use.
O.K. enough written..... I need my Time to debug
everything that crosses my way! Wink | ;-)

Comments and Discussions

 
GeneralCOM,COM+,DCOM Pinmemberciitpk30-Jul-04 2:40 
GeneralRe: COM,COM+,DCOM PinmemberThomas Latuske30-Jul-04 5:33 
General[Message Removed] Pinmemberstonber4-Oct-08 1:39 
Generalit needs clicking... Pinmemberradumoiceanu27-Apr-04 14:23 
GeneralRe: it needs clicking... PinmemberThomas Latuske28-Apr-04 6:53 
GeneralNo marquee please PinmemberThomas Freudenberg26-Apr-04 4:07 
GeneralRe: No marquee please PinmemberThomas Latuske26-Apr-04 7:05 
GeneralRe: No marquee please PinmemberThomas Freudenberg26-Apr-04 21:29 
GeneralGood PinmemberAaron Hudon25-Apr-04 18:40 
GeneralRe: Good PinmemberThomas Latuske26-Apr-04 7:04 
GeneralRe: Good PinmemberMichael Pearce23-May-04 18:00 
GeneralRe: Good PinmemberThomas Latuske24-May-04 7:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web04 | 2.8.141015.1 | Last Updated 25 Apr 2004
Article Copyright 2004 by Thomas Latuske
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid