1,新建MFC基于对话框的应用程序StereoTool;
2,添加对话框消息WM_SHOWWINDOW的处理函数:
void CStereoToolDlg::OnShowWindow (BOOL bShow, UINT nStatus){}
3,编辑处理函数:
void CStereoToolDlg::OnShowWindow (BOOL bShow, UINT nStatus) {
CDialogEx::OnShowWindow (bShow, nStatus);
// TODO: 在此处添加消息处理程序代码
// 获取对话框的原来位置信息(大小)
RECT rect_old = { 0 };
GetWindowRect (&rect_old);
// 位置变化,大小不表
RECT rect_new = { 0 };
rect_new.bottom = rect_old.bottom - rect_old.top;
rect_new.right = rect_old.right - rect_old.left;
// 移动到新位置
MoveWindow (0, 0, rect_new.right, rect_new.bottom);
}