1.添加WM_SHOWWINDOW消息处理函数
void CMyDlg::OnShowWindow(BOOL bShow, UINT nStatus)
{
CDialog::OnShowWindow(bShow, nStatus);
// TODO: Add your message handler code here
AnimateWindow(GetSafeHwnd(),600,AW_SLIDE|AW_HOR_NEGATIVE); //从右向左弹出
}
2.添加WM_CLOSEWINDOW
void CMyDlg::OnClose()
{
// TODO: Add your message handler code here and/or call default
AnimateWindow(GetSafeHwnd(),500,AW_BLEND|AW_HIDE); //淡出
CDialog::OnClose();
}
3.在StdAfx.h头部添加:
#ifndef WINVER
#define WINVER 0X500
#endif