Jump to content

WM ADJUSTFRAMEPOS

From EDM2
Revision as of 19:30, 9 April 2025 by Martini (talk | contribs) (Created page with "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 fo...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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 <syntaxhighlight lang="c">WinSetWindowPos</syntaxhighlight> or <syntaxhighlight lang="c">WinSetMultWindowPos</syntaxhighlight> function involves adjusting the position or size of a frame window, a <syntaxhighlight lang="c">WM_ADJUSTFRAMEPOS</syntaxhighlight> 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 <syntaxhighlight lang="c">WM_OWNERPOSCHANGE</syntaxhighlight> message. Each window receiving the a <syntaxhighlight lang="c">WM_OWNERPOSCHANGE</syntaxhighlight> message is expected to modify the <syntaxhighlight lang="c">SWP</syntaxhighlight> 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 <syntaxhighlight lang="c">SWP</syntaxhighlight> 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 <syntaxhighlight lang="c">SWP</syntaxhighlight> structure referenced by the <syntaxhighlight lang="c">pswp</syntaxhighlight> parameter. The rules for changing the state of these owned windows are:

  • <syntaxhighlight lang="c">SWP_SIZE</syntaxhighlight> and <syntaxhighlight lang="c">SWP_MOVE</syntaxhighlight>
    • The owned window is moved

relative to the top left corner of its owner.

  • <syntaxhighlight lang="c">SWP_SHOW</syntaxhighlight>
    • The visibility state of an owned window is changed

to agree with that of their owner.

  • <syntaxhighlight lang="c">SWP_MINIMIZE</syntaxhighlight>
    • An owned window is made invisible when the owner

is minimized.

  • <syntaxhighlight lang="c">SWP_MAXIMIZE</syntaxhighlight> and <syntaxhighlight lang="c">SWP_RESTORE</syntaxhighlight>
    • 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 <syntaxhighlight lang="c">WinSaveWindowPos</syntaxhighlight> function to associate those windows whose states are to change with the identifier of the frame window repositioning process, that is the <syntaxhighlight lang="c">hsavewp</syntaxhighlight> parameter. Eventually, the state changes to be made to the owned windows are contained in the array of <syntaxhighlight lang="c">SWP</syntaxhighlight> 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.