点击Add component to project...,在VC component中有一个SplashWindow,把它插入到你的工程就行了
解决方案 »
- 能否用对象或者指针直接调用对话框的句柄
- ACCESS数据库的问题
- 请问千千静听那样的换肤是怎么实现的?
- 在vc中如何调用excel数据画二维图形?excel中有两列数据,分别为横坐标,纵坐标的值
- 关于报表
- 编译一个dll,在本机运行没问题,做了安装包后换了一个机器运行出现问题
- CAsyncSocket问题,高手请进!
- 请问,模式对话框和无模式对话框的生成有什么不同。
- 关于atl在Win2K下可以,在Win98下不能正常运行的说明!
- MFC 如何实现下图功能,或者有这样的控件吗?
- 如何将skin++这类换肤库注入到其他进程中实现换肤?
- 在ClistCtrl中如何嵌套类似ClistTree的效果,如图
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;
}