windows_programming_notes.nbk: Home | Index | Next Page: WM_WININICHANGE | Previous Page: WM_WINDOWPOSCHANGED


 WM_WINDOWPOSCHANGING

The WM_WINDOWPOSCHANGING message is sent to a window whose size, position, or place in the Z order is about to change as a result of a call to the SetWindowPos function or another window-management function.

A window receives this message through its WindowProc function.

    LRESULT CALLBACK WindowProc(
      HWND hwnd,       // handle to window
      UINT uMsg,       // WM_WINDOWPOSCHANGING
      WPARAM wParam,   // not used
      LPARAM lParam    // size and position data (LPWINDOWPOS)
    );

Parameters

Return Values

If an application processes this message, it should return zero.

Remarks

For a window with the WS_OVERLAPPED or WS_THICKFRAME style, the DefWindowProc function sends the 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_BYTEALIGNWINDOW client styles. By not passing the WM_WINDOWPOSCHANGING message to the DefWindowProc function, an application can override these defaults.

While this message is being processed, modifying any of the values in WINDOWPOS affects the window's new size, position, or place in the Z order. An application can prevent changes to the window by setting or clearing the appropriate bits in the flags member of WINDOWPOS.

Requirements

  Windows NT/2000 or later: Requires Windows NT 3.1 or later.
  Windows 95/98/Me: Requires Windows 95 or later.
  Header: Declared in Winuser.h; include Windows.h.

windows_programming_notes.nbk: Home | Index | Next Page: WM_WININICHANGE | Previous Page: WM_WINDOWPOSCHANGED


Notebook exported on Monday, 7 July 2008, 18:56:50 PM Eastern Daylight Time