龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > 软件开发 > VC开发 >

在应用程序启动时显示 Abont 框(2)

时间:2009-12-30 15:42来源:未知 作者:admin 点击:
分享到:
5.在类 CSplash 的头文件中做下列改动,改动的代码用暗红色字体表示: class CSplash : public CDialog { // Construction public: CSplash(CWnd* pParent = NULL); // standard constru

  5.在类 CSplash 的头文件中做下列改动,改动的代码用暗红色字体表示:

class CSplash : public CDialog
{
// Construction
public:
    CSplash(CWnd* pParent = NULL);   // standard constructor
    BOOL Create(CWnd* pParentWnd);

// Dialog Data
    //{{AFX_DATA(CSplash)
    enum { IDD = IDD_ABOUTBOX };
    // NOTE: the ClassWizard will add data members here
    //}}AFX_DATA

  6.接着,在应用程序的源文件 Ld144.h 中,添加用暗红色字体表示的行。

class CLd1App : public CWinApp
{
private:
    CSplash m_splash;
    DWORD m_dwSplashTime;

public:
    CLd144App();

  7.在文件 Ld144.cpp 的方法 InitInstance 中做如下修改,修改的行用暗红色字体表示:

BOOL CLd1App::InitInstance()
{
    if(m_splash.Create(m_pMainWnd))
    {
    m_splash.ShowWindow(SW_SHOW);
    m_splash.UpdateWindow();
    }
    m_dwSplashTime=::GetCurrentTime();

    AfxEnableControlContainer();

    ... ...

    // The main window has been initialized, so show and update it.
    pMainFrame->ShowWindow(m_nCmdShow);
    pMainFrame->UpdateWindow();
    m_splash.BringWindowToTop();

    return TRUE;
}

精彩图集

赞助商链接