对话框大小的设置方法一:
CRect temprect(x, y, length, width); // (x,y)对话框左上角的坐标
CWnd::SetWindowPos(NULL,0,0,temprect.Width(),temprect.Height(),SWP_NOZORDER|SWP_NOMOVE);
方法二:
CRect rect_window= CRect(0, 0, 1200, 700);
MoveWindow(rect_window);
备注:
获取对话框显示屏幕的大小,但不包括任务栏等区域:
int cx =GetSystemMetrics(SM_CXFULLSCREEN);
int cy =GetSystemMetrics(SM_CYFULLSCREEN);
获取真正屏幕的大小,包括任务栏等区域:
int cx =GetSystemMetrics(SM_CXSCREEN);
int cy =GetSystemMetrics(SM_CYSCREEN);