如何在VC中实现淡入淡出的启动画面
以下为引用的内容:
#undef WINVER //取消原有版本定义,重新定义版本 #include <afxwin.h> |
然后在相关文件分别加入OnCreate,OnClose,OnEraseBkgnd和OnTimer消息函数。记得在相关构析函数内加入 :
以下为引用的内容:
SetTimer(1, 3000, NULL); //设定定时器1,定时3秒 |
OnCreate消息函数里添加淡入窗口或者背景位图代码
以下为引用的内容:
BOOL CSplashWnd::OnCreate(LPCREATESTRUCT lpcs) return true; |
OnClose消息函数是添加淡出窗口或背景位图代码:
以下为引用的内容:
void CSplashWnd::OnClose() CWnd::OnClose(); |
OnEraseBkgnd消息函数是添加背景 位图 :
以下为引用的内容:
BOOL CSplashWnd::OnEraseBkgnd(CDC *pDC) return true; |
OnTimer消息函数是添加定时关闭代码:
以下为引用的内容:
void CSplashWnd::OnTimer(UINT nIDEvent) |
是不是很简单,我看有些关于位图和窗口的淡入淡出很复杂,我刚学VC不久,看不懂。只好想出这简便的办法