Absrtact: This article provides four kinds of startup screen making methods.
Use the splash screen one can reduce the waiting program load process of the boring feeling (especially some large programs), and can be used to display the software name and copyright information such as the message. How to use VC + + to make application launch screen? This article provides four methods, the first three for document based applications, and the fourth for dialog based applications.
1. Using the splash screen component in the component library to implement
(1) Use Photoshop to make the splash image, save it as BMP format.
(2) Build a project splash based on single document with AppWizard.
(3) Insert bitmap resources in the resource
Open the VC + + resource Editor, right-click the Resources folder, select the Import command, insert the created bitmap. If the bitmap is more than 256 colors, VC will pop up a dialog box, hint that the bitmap has been inserted but not in the bitmap editor to display, OK. Change the bitmap ID to Idb_splash.
(4) Add splash screen control
① Select Menu "Project"/"ADD to Project"/"Conponents and Controls" Open the dialog box, double-click the Visual C + + conponents option in the list box, and select the Splash screen control. then click Insert.
② confirm or modify the class name and bitmap resource ID, click OK to confirm.
③ compile, connect, the beautiful splash screen is displayed.
(5) If you need to change the duration of the splash screen, modify the second parameter of the SetTimer () function, the default is 750 milliseconds. Where the function is located:
int CSplashWnd::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
...
// Set a timer to destroy the splash screen.
SetTimer(1, 750, NULL); //修改第二个参数以调整画面停留时间
return 0;
}
2. Display splash screen using modeless dialog box