How to create the startup Interface C ++/VC

Source: Internet
Author: User
How to create the startup Interface C ++/VC
Implement splash screen 1. Install the splash screen component. Click Project/Add to project/component and control in the menu, double-click visual c ++ components, and select the splash screen component, the default ID is idb_splash. (I have some questions here. When I accept the default ID, there will always be no pop-up screen when the program is running. Just retrieve a new ID and try again !) 2. Insert a bitmap to replace the generated one with a prepared bitmap. The true color bitmap is invisible in the resource editor (it cannot open images of more than 256 colors! Alternatively, click resouce view, right-click bitmap, and select "Import ..." Select the source bitmap and set the bitmap ID to idb_splash .. 3. Run the program to compile and connect. The beautiful startup bitmap is displayed. That's easy! Iv. Description 1. If you want to change the stop time of the startup screen, modify the second parameter in settime, Which is 750 milliseconds. Int csplashwnd: oncreate (maid) {If (cwnd: oncreate (maid) =-1) Return-1;
// Center the window. centerwindow ();
// Set a timer to destroy the splash screen. settimer (1,750, null); the stay time is 0. 75 seconds. You can modify the second parameter to change the screen flash time!
Return 0;} 2. A dialog box-based program cannot insert a pop-up screen. You can set it as follows: First, create a dialog box project and add the generated splash. CPP and splash. copy the H file to the working folder and add it to your project based on the dialog box (Project-> Add to project-> files ...). Add the following code to the initinstance () of the cdialogapp derived class: # include "Splash. H "bool cdialogapp: initinstance () {// CG: The following block was added by the splash screen component. {ccommandlineinfo cmdinfo; parsecommandline (cmdinfo); csplashwnd: enablesplashscreen (cmdinfo. m_bshowsplash );}......} use Class Wizard to add the oncreate () function to the cdialog derived class and add the following code: # include "Splash. H "int cdialogldlg: oncreate (maid) {If (cdialog: oncreate (lpcreatestruct) =-1) Return-1; // CG: the following line was added by thesplash screen component. csplashwnd: showsplashscreen (this); Return 0;} finally splash. in the CPP file, change the bitmap resource ID in the csplashwnd: Create () function to the ID of the true color bitmap. Bool csplashwnd: Create (cwnd * pparentwnd/* = NULL */) {If (! M_bitmap.loadbitmap (idb_bitmap1) return false ;......}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.