Method 1:
Add the following to Dialog: OnInitDialog:
ModifyStyle (WS_CAPTION,); // if you only want a normal full screen and do not want to remove the title bar, you do not need to use the first statement.
SendMessage (WM_SYSCOMMAND, SC _MAXIMIZE, 0 );
However, this method is not convenient to adjust the widget location. You can consider method 2.
Method 2:
First get the resolution,
Int cx, cy;
Cx = GetSystemMetrics (SM_CXSCREEN );
Cy = GetSystemMetrics (SM_CYSCREEN );
Use MoveWindow
CRect rcTemp;
RcTemp. BottomRight () = CPoint (cx, cy );
RcTemp. TopLeft () = CPoint (0, 0 );
MoveWindow (& rcTemp );
Method 2 because the window and screen parameters are obtained, it is much easier to adjust the positions of some controls on the Dialog.
++ ++ ++
However, you can only adjust the widget's size position in OnSize. You need to adjust the size and position of all controls to be adjusted one by one.
For the method, see:
Three steps to solve the control size after the MFC window changes
1. Define POINT Old in the header file; // store the width and height of the dialog box.
2. Add the WM_SIZE message:
3. Add the reseze Function
Http://blog.csdn.net/Small_hunter/article/details/5640101
Detailed code in