Visual C++ and MFC Programming 2nd Edition

(Martin Jones) #1

Chapter 15: Fundamental Controls Visual C++ and MFC Fundamentals


Value Description

wndBottom This window will be positioned under all the other windows, unless
it is already at the bottom. If this window is a topmost window, it
will not be anymore
wndTop This window will be positioned on top of all the other windows,
unless it is already on top
wndTopMost This window becomes positioned on top of all other window as if it
were created with the WS_EX_TOPMOST extended style. In
other words, even if its parent window is sent under other window,
this particular one stays on top.
wndNoTopMost If this window is not a top most window, it becomes positioned on
top of all other windows, except the window that is top most.
If this window was top most when it called this method, it is not
top most anymore. If there is another top most window on the
screen, that one becomes top most but this one becomes positioned
under that one.

If you are not trying to reposition the window in the Z coordinate, pass this argument as
NULL or include the SWP_NOZORDER value for the nFlags argument.

The nFlags argument is used to define how the location arguments (x and y) and the
dimensions (cx and cy) will be dealt with. These other arguments have the following
roles:

Argument Description

The argument is
ignored if nFlags has
the following value
x This specifies the new distance from the left
border of the parent to the left border of this
window. This depends on the type of window
and the type of parent.

SWP_NOMOVE

y This specifies the new distance from the top
border of the parent to the top border of this
window. This depends on the type of window
and the type of parent.

SWP_NOMOVE

cx This is the new width of this window SWP_NOSIZE
cy The argument is the new height of this
window

SWP_NOSIZE

Additionally, the nFlags argument can have one of the following values or one of the
above nFlags values can be combined with the following values:

Value Description
SWP_DRAWFRAME Draws a frame around the window
SWP_FRAMECHANGED This value sends a WM_NCCALCSIZE message to the
window
SWP_HIDEWINDOW Hides this window
SWP_NOACTIVATE If the pWndInsertAfter value specified that the window
should be reposositioned and activated, which is done if
the window is to be positioned on top of another, this
Free download pdf