1 如何创建启动画面始终置顶不必担心被切换
void CBSplashWindow::CreateSplash()
{
//Create Splash Window
CWnd::CreateEx(WS_EX_TOPMOST, AfxRegisterWndClass(0), NULL, WS_POPUP, 0, 0,
m_bmBitmap.bmWidth, //Bitmap Width = Splash Window Width
m_bmBitmap.bmHeight, //Bitmap Height = Splash Window Height
NULL,
NULL,
NULL);
CenterWindow();
ShowWindow(SW_SHOW);
UpdateWindow();
}
2 如何显示超过3秒
CTime time = CTime::GetCurrentTime();
int oldTime = time.GetMinute()* 60 + time.GetSecond();
time = CTime::GetCurrentTime();
int timeDiff = time.GetMinute()* 60 + time.GetSecond() - oldTime;
if((timeDiff < 3) && (timeDiff >= 0)) //未到3秒则延时
{
int iSleepTime = (3 - timeDiff) * 1000;
Sleep(iSleepTime);
}