VC Four kinds of Program start screen production method

Source: Internet
Author: User
Tags resource

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

Related Article

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.