Jump to content

WM ADJUSTFRAMEPOS: Difference between revisions

From EDM2
No edit summary
 
Line 44: Line 44:




[[Category:WM]]
[[Category:Messages]]

Latest revision as of 22:57, 9 April 2025

This message is sent to a frame window whose position or size is to be adjusted.

Syntax

param1
    PSWP     pswp          /*  New frame window state. */

param2
    HSAVEWP  hsavewphsvwp  /*  Identifier of the frame window repositioning process. */

Parameters

pswp (PSWP)
New frame window state.
This points to a SWP structure.
The structure has been filled in by the WinSetWindowPos or WinSetMultWindowPos functions with the proposed move or size data for the frame window.
hsavewphsvwp (HSAVEWP)
Identifier of the frame window repositioning process.

Returns

ulReserved (ULONG)
Reserved value, should be 0.

Remarks

When a WinSetWindowPos or WinSetMultWindowPos function involves adjusting the position or size of a frame window, a WM_ADJUSTFRAMEPOS message is sent to the frame window.

The frame control processes the message by informing all the windows in its owner hierarchy, that is all the windows owned by the frame and all the windows owned by them and so on, by sending each a WM_OWNERPOSCHANGE message. Each window receiving the a WM_OWNERPOSCHANGE message is expected to modify the SWP structure provided as the first parameter in the message to the appropriate values relative to the new position and/or size of its owner, whose new position and size is specified in a SWP structure provided as the second parameter in the message.

In this way the frame control can determine the state changes to be made to all the windows in its owner hierarchy, in accordance with the values specified in the SWP structure referenced by the pswp parameter. The rules for changing the state of these owned windows are:

SWP_SIZE and SWP_MOVE
The owned window is moved relative to the top left corner of its owner.
SWP_SHOW
The visibility state of an owned window is changed to agree with that of their owner.
SWP_MINIMIZE
An owned window is made invisible when the owner is minimized.
SWP_MAXIMIZE and SWP_RESTORE
An owned window that was previously made invisible when the owner was minimized is made visible.

The frame window coordinates the repositioning of the frame window and all its owned windows, by using the WinSaveWindowPos function to associate those windows whose states are to change with the identifier of the frame window repositioning process, that is the hsavewphsvwp parameter. Eventually, the state changes to be made to the owned windows are contained in the array of SWP structures identified by the parameter.

If the frame window is subclassed, this message must then be passed to the superclass window procedure for processing. The superclass window procedure is the window procedure of the window before it was subclassed. This message is passed along the chain of window procedures and is eventually processed by the system frame window procedure.

Default Processing

The default window procedure takes no action on this message, other than to set ulReserved to 0.