MoveWindow (); Explanation of function usage

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.