1. Define the window size after a CRect is saved and started.
M_rect
2. Write the following code in the OninitDialog event:
GetWindowRect (& m_rect );
WINDOWPLACEMENT wp;
Wp. length = sizeof (WINDOWPLACEMENT );
Wp. flags = WPF_RESTORETOMAXIMIZED;
Wp. showCmd = SW_HIDE; SetWindowPlacement (& wp );
// Set a timer to hide the timer and then return to the original state, or reply in the real window,
SetTimer (6, 1, NULL );
3. Timer event
// Restore the original size
// SWP_HIDEWINDOW is a hidden option, and SWP_SHOWWINDOW is a realistic option.
SetWindowPos (& wndNoTopMost, m_rect.left, m_rect.top, m_rect.right, m_rect.bottom, SWP_HIDEWINDOW );
KillTimer (6 );
-----------------------------------------------------------------
Note: Move the code from the window to the lower right corner
Void MoveToRightCorner (void)
{
RECT rcWorkArea;
// Obtain the customer's available Workspace
If (SystemParametersInfo (SPI_GETWORKAREA, 0, & rcWorkArea, 0 ))
{
CRect rcWindow;
GetWindowRect (rcWindow );
// Obtain the area to be moved to the bottom right corner.
CRect rcMoveRect;
RcMoveRect. left = rcWorkArea. right-rcWindow. Width ();
RcMoveRect. right = rcWorkArea. right;
RcMoveRect. top = rcWorkArea. bottom-rcWindow. Height ();
RcMoveRect. bottom = rcWorkArea. bottom;
MoveWindow (rcMoveRect );
}
}