VC:使用VC自带的splash screen控件

来源:互联网 发布:mac ps 添加字体 编辑:程序博客网 时间:2024/04/30 07:49
 

STEP1:导入控件,并生成对应的类,及头文件

 

STEP2:导入后,VC会帮我们加入如下代码
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{

 CSplashWnd::ShowSplashScreen(this);
 
}

STEP3:根据自己的要求,修改参数或方法。如修改显示Splash Screen的时间,如下:
int CSplashWnd::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
 if (CWnd::OnCreate(lpCreateStruct) == -1)
  return -1;

 // Center the window.
 CenterWindow();

 // Set a timer to destroy the splash screen.
 SetTimer(1, 3000, NULL);

 return 0;
}