Objective Toolkit : Chapter 15 User Interface Extensions : Splash Window
Splash Window
A splash window is a transient window that appears temporarily when the user starts the application. Generally, the pop-up window displays a copyright notice while the application is initialized.
The SECSplashWnd Class
The SECSplashWnd class provides you with a ready-to-use splash window for your applications. All you need to do is insert a splash bitmap and text. The splash window deletes itself after a specified time or when the user clicks it, so you do not have to keep track of the splash window in your application.
Figure 119 – Objective Toolkit’s Splash Window Class Hierarchy
Table 39 lists and describes the SECSplashWnd methods.
Table 39 – SECSplashWnd Methods 
Method
Description
AllowUserDismiss()
Sets whether the user can dismiss the Splash Screen by clicking the mouse or pressing a key. Default: True.
EnableTimer()
You can create the Splash Screen without enabling the timer. Call this function to start the countdown.
SetTaskbarTitle()
The Splash Screen can include a taskbar entry. Use this function to set the Taskbar Caption. Default: No taskbar entry.
SetAlwaysOnTop()
You can set the Splash Screen to WS_EX_TOPMOST. Default: Not set to WS_EX_TOPMOST, unless it is created before the application’s main window.
PostSplashDraw()
This is an overridable method that lets you paint on top of the Splash Screen after it is rendered to the screen.
Dismiss()
This function dismisses the Splash Screen.
DisableParent()
You can disable or enable the parent of the Splash Screen when the Splash Screen is displayed. Default: Parent enabled.
The SECSplashWnd constructor has an alternate constructor that takes two additional parameters— bWaitForTimer and bAlwaysOnTop.
 
SECSplashWnd(UINT nNewBitmapID,
UINT nNewDuration = 2500,
BOOL bWaitForTimer = FALSE,
BOOL bAlwaysOnTop = FALSE);
If you want to display a login or password dialog with SECSplashWnd as the parent, set the third parameter to TRUE and then call EnableTimer() when you dismiss the dialog.
Using SECSplashWnd
To add SECSplashWnd to your application:
1. In the Visual Studio resource editor, add a splash screen bitmap resource.
2. Create an instance of SECSplashWnd on the heap. In the constructor, specify the bitmap ID and the duration for the splash window. For example:
 
m_pSplashWnd = new SECSplashWnd(IDB_SPLASHWND,3500);
3. Call the Create() method to create the splash window.
 
m_pSplashWnd->Create();
SECSplashWnd Samples
The sample Splash51 demonstrates the 32-bit implementation of SECSplashWnd. This sample also uses the SECRegistry classes to read the user’s name from the registry and display it on the splash screen during application startup. When you open the project in Visual Studio, the bitmap used by SECSplashWnd appears in the list of application resources.
This sample does not ship with the product. For information on how to obtain this sample, see “Location of Sample Code” in the Getting Started part.