Visual C++ and MFC Programming 2nd Edition

(Martin Jones) #1

Visual C++ and MFC Fundamentals Chapter 5: The Document/View Architecture


minimized
SIZE_MAXHIDE Another window, other than this one, has been maximized
SIZE_MAXSHOW Another window, other than this one, has been restored from
being maximized or minimized

The cx argument specifies the new width of the client area of the window
The cy argument specifies the new height of the client area of the window.
To use this message, you should first call its implementation in the parent class before
implementing the behavior you want. This can be done as follows:

void CAnyWindow::OnSize(UINT nType, int cx, int cy)
{
CParentClass::OnSize(nType, cx, cy);

// TODO: Add your message handler code here
}

WM_SIZING: While the user is changing the size of a window, a message called
ON_WM_SIZING is being sent. Its syntax is:

afx_msg void OnSizing(UINT nSide, LPRECT lpRect);

When a user is resizing a window, he or she typically drags one of the borders or corners
on a direction of his or her choice. The first argument, nSize, indicates what edge is being
moved when resizing the window. It can have one of the following values:

Value Description
WMSZ_BOTTOM Bottom edge
WMSZ_BOTTOMLEFT Bottom-left corner
WMSZ_BOTTOMRIGHT Bottom-right corner
WMSZ_LEFT Left edge
WMSZ_RIGHT Right edge
WMSZ_TOP Top edge
WMSZ_TOPLEFT Top-left corner
WMSZ_TOPRIGHT Top-right corner
Free download pdf