MFC 对话框的滑动弹出与淡出

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


你可能感兴趣的:(MFC,MFC,滑动,对话框,淡出)