[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 SetWindowPos( hWnd, hWndAfter, nCol, nRow,;
                     nWidth, nHeight, nFlags )-> <lSuccess>
------------------------------------------------------------------------------


 PARAMETER:

  <hWnd>        Is the handle that identifies the target window

  <hWndAfter>   Identifies the window to precede the positioned window in
                the Z-order. This parameter must be a window handle or one 
                of the following values:

                 HWND_BOTTOM    Places the window at the bottom of the 
                  [1]           Z-order. If hwnd identifies a topmost 
                                window, the window loses its topmost 
                                status; the system places the window at
                                the bottom of all other windows.

                 HWND_TOP       Places the window at the top of the Z-order
                  [0]
                 HWND_TOPMOST   Places the window above all non-topmost
                  [-1]          windows. The window maintains topmost 
                                position even when it is deactivated.

                 HWND_NOTOPMOST Repositions the window to the top of all
                  [-2]          non-topmost windows (that is, behind all
                                topmost windows). 
                                This flag has no effect if the window is
                                already a non-topmost window


  <nRow>, <nCol>      The new window coordinates.

  <nWidth>,<nHeight>  The new dimensions of the window.

  <nFlags>            Specifies the window sizing and positioning options.
                      This parameter can be a combination of the following
                      values:

                      SWP_DRAWFRAME  Draws a frame (defined in the window's
                       [032]         class description) around the window.

                      SWP_HIDEWINDOW Hides the window.
                       [0128]
                      SWP_NOACTIVATE Does not activate the window. If this
                       [016]         flag is not set, the window is 
                                     activated and moved to the top of
                                     either the topmost or non-topmost 
                                     group (depending on the setting of the
                                     <hwndInsertAfter> parameter).

                      SWP_NOMOVE     Retains the current position (ignores
                       [002]         the nRow, nCol parameters).

                      SWP_NOSIZE     Retains the current size (ignores the
                       [001]         nWidth, nHeight parameters).

                      SWP_NOREDRAW   Does not redraw changes. If this flag
                       [008]         is set, no repainting of any kind 
                                     occurs. 

                      SWP_NOZORDER   Retains the current ordering (ignores
                       [004]         the <hwndInsertAfter> parameter).

                      SWP_SHOWWINDOW Displays the window. If is or the 
                       [064]         SWP_HIDEWINDOW flags are set, the 
                                     window cannot be moved or sized.


 RETURNS:

 <lSuccess> is TRUE if the operation was performed successfully.



 DESCRIPTION:

  The SetWindowPos function changes the size, position, and Z-order of 
  child, pop-up, and top-level windows. These windows are ordered according
  to their on the screen; the window on top receives the highest rank and
  is the window in the Z-order. 
  All coordinates for child windows are client coordinates (relative to the
  upper-left corner of the parent window's client area).

  A window can be made a topmost window either by setting the hwndAfter 
  parameter to HWND_TOPMOST and ensuring that the SWP_NOZORDER flag is not
  set, or by setting a window's Z-order so that it is above any existing 
  topmost windows. When a non-topmost window is made topmost, its owned 
  windows are also made topmost. Its owners are not changed.

  If neither SWP_NOACTIVATE nor SWP_NOZORDER is specified (that is, when 
  the application requests that a window be simultaneously activated and 
  placed in the specified Z-order), the value specified in hwndAfter is 
  used only in the following circumstances:

   - Neither HWND_TOPMOST or HWND_NOTOPMOST is specified in the <hwndAfter>
     parameter
   - The window specified in the hwnd parameter is not the active window.

  An application cannot activate an inactive window without also bringing
  it to the top of the Z-order. Applications can change the Z-order of an
  activated window without restrictions or activate a window, and then 
  move it to the top of the topmost or non-topmost windows. 
  A topmost window is no longer topmost if it is repositioned to the 
  bottom (HWND_BOTTOM) of the Z-order or after any non-topmost window.
  When a topmost window is made non-topmost, all of its owners and its
  owned windows are also made non-topmost windows.

  A non-topmost window may own a topmost window, but not vice versa.
  Any window (for example, a dialog box) owned by a topmost window is 
  itself made a topmost window, to ensure that all owned windows stay above
  their owner.


 SOURCE:

  SOURCE\WINAPI\WNDPOS.C



See Also: MoveWindow
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson