WM_WINDOWPOSCHANGING

The WM_WINDOWPOSCHANGING message is sent to a window whose size, position, and/or Z order is about to change as a result of a call to SetWindowPos or other window-management function.

Parameters

wParam

This parameter is not used.

lParam

Points to a WINDOWPOS data structure that contains information about the window's new size and position.

The WINDOWPOS structure has the following form:

typedef struct tagWINDOWPOS { /* wp */

HWND hwnd;

HWND hwndInsertAfter;

int x;

int y;

int cx;

int cy;

UINT flags;

} WINDOWPOS;

Return Value

An application should return zero if it processes this message.

Comments

During this message, modifying any of the values in the WINDOWPOS structure affects the new size, position, or Z order. An application can prevent changes to the window by setting or clearing the appropriate bits in the flags member.

For a window with the WS_OVERLAPPED or WS_THICKFRAME style, the DefWindowProc function handles a WM_WINDOWPOSCHANGING message by sending a WM_GETMINMAXINFO message to the window. This is done to validate the new size and position of the window and to enforce the CS_BYTEALIGNCLIENT and CS_BYTEALIGN client styles. An application can override this functionality by not passing the WM_WINDOWPOSCHANGING message to the DefWindowProc function.

See Also

WM_WINDOWPOSCHANGED