Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

WINDOWPOS Structure 

The WINDOWPOS structure contains information about the size and position of a window.

typedef struct tagWINDOWPOS { /* wp */
   HWND hwnd;
   HWND hwndInsertAfter;
   int x;
   int y;
   int cx;
   int cy;
   UINT flags;



Identifies the window.


Identifies the window behind which this window is placed.


Specifies the position of the left edge of the window.


Specifies the position of the right edge of the window.


Specifies the window width, in pixels.


Specifies the window height, in pixels.


Specifies window-positioning options. This member can be one of the following values:

  • SWP_DRAWFRAME   Draws a frame (defined in the class description for the window) around the window. The window receives a WM_NCCALCSIZE message.

  • SWP_FRAMECHANGED   Sends a WM_NCCALCSIZE message to the window, even if the window's size is not being changed. If this flag is not specified, WM_NCCALCSIZE is sent only when the window's size is being changed.

  • SWP_HIDEWINDOW   Hides the window.

  • SWP_NOACTIVATE   Does not activate the window.

  • SWP_NOCOPYBITS   Discards the entire contents of the client area. If this flag is not specified, the valid contents of the client area are saved and copied back into the client area after the window is sized or repositioned.

  • SWP_NOMOVE   Retains current position (ignores the x and y members).

  • SWP_NOOWNERZORDER   Does not change the owner window's position in the Z-order.

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

  • SWP_NOREDRAW   Does not redraw changes.


  • SWP_NOSENDCHANGING   Prevents the window from receiving the WM_WINDOWPOSCHANGING message.

  • SWP_NOZORDER   Retains current ordering (ignores the hwndInsertAfter member).

  • SWP_SHOWWINDOW   Displays the window.

Community Additions

© 2015 Microsoft