Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- FiveWin 1.9.2 - January 97 - setwindowpos() changes the position of a window http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 SetWindowPos()         Changes the position of a Window
--------------------------------------------------------------------------------

   Syntax:              SetWindowPos( <hWnd>, <hWndAfter>, <nCol>, <nRow>,
                                      <nWidth>, <nHeight>, <nFlags> )
                                      --> <lSuccess>
   Parameters:

   <hWnd>               Identifies the window to be positioned.

   <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:

                        Value         Meaning

                        HWND_BOTTOM   Places the window at the bottom of
                                      the 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.

                        HWND_TOPMOST  Places the window above all non-topmost
                                      windows. The window maintains its
                                      topmost position even when it is
                                      deactivated.

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

   <nCol>, <nRow>       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:

                        Value          Meaning

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

                        SWP_HIDEWINDOW Hides the window.

                        SWP_NOACTIVATE Does not activate the window. If this
                                       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
                                       the x and y parameters).

                        SWP_NOSIZE     Retains the current size (ignores the
                                       cx and cy parameters).

                        SWP_NOREDRAW   Does not redraw changes. If this flag
                                       is set, no repainting of any kind
                                       occurs. This applies to the client
                                       area, the non-client area (including
                                       the title and scroll bars), and any
                                       part of the parent window uncovered
                                       as a result of the moved window.
                                       When this flag is set, the application
                                       must explicitly invalidate or redraw
                                       any parts of the window and parent
                                       window that must be redrawn.

                        SWP_NOZORDER   Retains the current ordering (ignores
                                       the hwndInsertAfter parameter).

                        SWP_SHOWWINDOW Displays the window.

   Returns:

   <lSuccess>           A logical value indicating if the
                        operation was performed successfully.

   Observations:        If the SWP_SHOWWINDOW or the SWP_HIDEWINDOW flags are
                        set, the window cannot be moved or sized.

                        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.

   Sample:              SAMPLES\\TestTop.prg

   Source code:         SOURCE\\WINAPI\\WndPos.c

   See also:            MoveWindow()


Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson