Excerpt from: http://blog.csdn.net/yjkwf/article/details/5281207 Cwnd::movewindow Detailed2010-02-02 16:08 3432 People read Comments (0) favorite reports Mfc
Cwnd::movewindow
void MoveWindow (int x, int y, int nwidth, int nheight, BOOL brepaint = TRUE);
void MoveWindow (Lpcrect lpRect, BOOL brepaint = TRUE);
function function: This function changes the position and size of the specified window. For the top-level window, the position and dimensions are relative to the upper-left corner of the screen: for child windows, the position and dimensions are relative to the upper-left coordinates of the parent window's client area.
Function prototype: BOOL movewindow (int x.int y,int nwidth,int nheight,bool brepaint);
Parameters:
X: Specifies the left edge of the window's new position.
Y: Specifies the top boundary of the new position of the window.
Nwidth: Specifies the new width of the window.
Nhaight: Specifies the new height of the window.
In MFC, only the parameter x,y,nwidth,nheight;
Brepaint: Determines whether the window is refreshed. If this argument is true, the window receives a WM_PAINT message, and if the argument is false, no flush action occurs. It applies to the customer area, the non-client area (including the title bar and scroll bar), and the area of the parent window that is exposed as a result of moving the child window. If the argument is false, the application must explicitly invalidate the window or repaint the window and the parent window that needs to be refreshed.
Return value: If the function succeeds, the return value is not 0, and if the function fails, the return value is zero. To get more error information, call the GetLastError function.
Note: If Brepaint is true, the system sends a WM_PAINT message to the window procedure immediately after the window is moved (that is, the UpdateWindow function is called by the MoveWindow function). If Brepaint is false, the system places the WM_PAINT message in the message queue for that window. Message loops dispatch WM_PAINT messages only when other messages in the message queue are dispatched.
MoveWindow sends Wm_windowposchanging,wm_windowposchanged,wm_move,wm_size and WM_NCCALCSIZE messages to the window,
MoveWindow (); Explanation of function usage