扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
#undef WINVER //取消原有版本定义,重新定义版本 #define WINVER 0x5000 //为了使AnimateWindow函数可用 #include <afxwin.h> |
SetTimer(1, 3000, NULL); //设定定时器1,定时3秒 |
BOOL CSplashWnd::OnCreate(LPCREATESTRUCT lpcs) { CenterWindow(); //窗口位于屏幕中心 AnimateWindow(GetSafeHwnd(), 500, AW_BLEND); //淡入图片0.5秒 return true; } |
void CSplashWnd::OnClose() { AnimateWindow(GetSafeHwnd(), 500, AW_BLEND | AW_HIDE); //淡出图片0.5秒 CWnd::OnClose(); } |
BOOL CSplashWnd::OnEraseBkgnd(CDC *pDC) { DDB mSplashBitmap; mSplashBitmap.DisplayDDB(pDC, IDB_SPLASH); //显示位图资源IDB_SPLASH return true; } |
void CSplashWnd::OnTimer(UINT nIDEvent) { KillTimer(1); //关闭定时器1 PostMessage(WM_CLOSE, 0, 0); //发送关闭窗口信息 } |
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。