主要使用AnimateWindow API函数,在OnInitDialog中添加如下代码:
//获得桌面大小
CRect rectWorkArea;
SystemParametersInfo(SPI_GETWORKAREA,0,&rectWorkArea,SPIF_SENDCHANGE);
//获得对话框大小
CRect rectDlg;
GetWindowRect(&rectDlg);
int nW = rectDlg.Width();
int nH = rectDlg.Height();
//将窗口设置到右下脚
::SetWindowPos(this->m_hWnd,HWND_BOTTOM,
rectWorkArea.right-nW,rectWorkArea.bottom-nH,
nW,nH,
SWP_NOZORDER);
//动画显示
::AnimateWindow(GetSafeHwnd(),800,AW_SLIDE|AW_VER_NEGATIVE);
要使用AnimateWindow还必须在StdAfx.h添加:
#undef WINVER
#define WINVER 0x500
关于AnimateWindow的使用可以看:
http://baike.baidu.com/view/1080291.htm
//获得桌面大小
CRect rectWorkArea;
SystemParametersInfo(SPI_GETWORKAREA,0,&rectWorkArea,SPIF_SENDCHANGE);
//获得对话框大小
CRect rectDlg;
GetWindowRect(&rectDlg);
int nW = rectDlg.Width();
int nH = rectDlg.Height();
//将窗口设置到右下脚
::SetWindowPos(this->m_hWnd,HWND_BOTTOM,
rectWorkArea.right-nW,rectWorkArea.bottom-nH,
nW,nH,
SWP_NOZORDER);
//动画显示
::AnimateWindow(GetSafeHwnd(),800,AW_SLIDE|AW_VER_NEGATIVE);
要使用AnimateWindow还必须在StdAfx.h添加:
#undef WINVER
#define WINVER 0x500
关于AnimateWindow的使用可以看:
http://baike.baidu.com/view/1080291.htm