点击Add   component   to   project...,在VC   component中有一个SplashWindow,把它插入到你的工程就行了

解决方案 »

  1.   

    http://soft.zol.com.cn/2005/0425/166307.shtml
      

  2.   

    //CSplashWindow.h
    class CSplashWindow : public CWnd
    {
    private:
        CDC MemDC;
        BITMAP bmBitmap;
        CBitmap m_Bitmap;
        CBitmap *Old_Bitmap;public:
        CSplashWindow();
        ~CSplashWindow();
        void CreateSplash();
        afx_msg void OnPaint();
        DECLARE_MESSAGE_MAP()
    };// SplashWindow.cpp :  CSplashWindow 类的实现#include "stdafx.h"
    #include "resource.h"
    #include "SplashWindow.h"BEGIN_MESSAGE_MAP(CSplashWindow, CWnd)
        ON_WM_PAINT()
    END_MESSAGE_MAP()CSplashWindow::CSplashWindow()
    {
        m_Bitmap.LoadBitmap(MAKEINTRESOURCE(IDB_SPLASHWINDOW)); //Load Bitmap
        m_Bitmap.GetBitmap(&bmBitmap);        //Get Bitmap Info
    }CSplashWindow::~CSplashWindow()
    {
    }void CSplashWindow::CreateSplash()
    {
        //Create Splash Window
        CWnd::CreateEx(0,
        AfxRegisterWndClass(
                            0,
                AfxGetApp()->LoadStandardCursor(IDC_UPARROW)),
                NULL,
    //            "SplashWindow Sample",
                WS_POPUP,
                0,
                0,
                bmBitmap.bmWidth,  //Bitmap Width = Splash Window Width
                bmBitmap.bmHeight, //Bitmap Height = Splash Window Height
                NULL,
                NULL,
                NULL);
    }void CSplashWindow::OnPaint()
    {
        CPaintDC dc(this);    CBrush brush;
        brush.CreateSolidBrush(RGB(64,64,255));
        dc.SelectObject(&brush);
        dc.Rectangle(0,0,bmBitmap.bmWidth,bmBitmap.bmHeight);    MemDC.CreateCompatibleDC(NULL); //Create Memory DC
        Old_Bitmap = MemDC.SelectObject(&m_Bitmap); //Select DC    int num = bmBitmap.bmWidth/40;
        dc.StretchBlt(0,0,bmBitmap.bmWidth,bmBitmap.bmHeight,&MemDC,0,0,bmBitmap.bmWidth,bmBitmap.bmHeight,SRCCOPY);/*  for(int k=0; k <40; k++)  //百叶窗效果
        {
            for(int m=0; m <num+1; m++)
            {
                dc.BitBlt(m*40+k,0,1,bmBitmap.bmHeight,&MemDC,m*40+k,0,SRCCOPY);
        }
        Sleep(1);
        }*/
       
        MemDC.SelectObject(Old_Bitmap); //Select Bitmap
    }
    在你App类的InitInstance函数中C/C++ codeBOOL CXxxxApp::InitInstance()
    {
        CWinApp::InitInstance();    CSplashWindow *pSplashWindow = new CSplashWindow;
        pSplashWindow->CreateSplash();
        pSplashWindow->CenterWindow();
        pSplashWindow->ShowWindow(SW_SHOW);
        pSplashWindow->UpdateWindow();
        Sleep(3000); //Delay 3 Second
        pSplashWindow->DestroyWindow();
        delete pSplashWindow;    ...
        return true;
    }