win12.hlp (Table of Contents; Topic list)
WinFormatFrame (1.2)
Function Group  Overview                          Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_WINFRAMEMGR
 
SHORT WinFormatFrame(hwndFrame, prclFrame, pswp, cswpMax, prclClient)
HWND hwndFrame;   /* handle of window with frame controls to be formatted */
PRECTL prclFrame; /* address of structure with rectangle                  */
PSWP pswp;        /* address of array of structures                       */
USHORT cswpMax;   /* number of SWP structures                             */
PRECTL prclClient;/* address of client window rectangle                   */
 
The WinFormatFrame function calculates the size and position of all standard
frame controls within a frame window. The data is calculated and returned in
an array with one entry for each control window. This function allows an
application which has subclassed its frame window, to more easily modify the
appearance of a frame window and its controls.
 
Parameter   Description
────────────────────────────────────────────────────────────────────────────
 
hwndFrame   Identifies the window whose frame controls are to be formatted.
 
prclFrame   Points to the RECTL structure that contains the rectangle where
            the frame controls are formatted. This typically is the window
            rectangle identified by the hwndFrame parameter, but where the
            window has a wide border, (for example, as specified by
            FS_DLGBORDER), the rectangle is inset by the size of the
            border.
 
pswp        Points to an array of SWP structures. There must be one SWP
            structure for each frame control. Typically, the count of frame
            windows is calculated as follows:
 
                 (FID_CLIENT - FID_SYSMENU + 1)
 
            This can change, however, if the frame window is subclassed.
 
cswpMax     Specifies the number of SWP structures.
 
prclClient  Points to the window rectangle of the FID_CLIENT window after
            formatting. If this parameter is NULL, no client window
            rectangle is returned.
 
Return Value
 
The return value is the number of SWP structures returned in the array
pointed to by pswp.
 
Comments
 
An SWP structure will be filled in for the following frame controls:
 
Value           Meaning
────────────────────────────────────────────────────────────────────────────
FID_CLIENT      Identifies the client window.
 
FID_HORZSCROLL  Identifies the horizontal scroll bar.
 
FID_MENU        Identifies the system menu.
 
FID_MINMAX      Identifies the minimum/maximum box.
 
FID_SYSMENU     Identifies the system menu.
 
FID_TITLEBAR    Identifies the title bar.
 
FID_VERTSCROLL  Identifies the vertical scroll bar.
 
The returned array of SWP structures can be used in the WinSetMultWindowPos
function to set the position and size of the frame windows.
 
The WinFormatFrame function typically is used by applications that require a
nonstandard frame-window layout. This function is called while the
WM_UPDATEFRAME message is being processed. The application should alter the
calculated positions and sizes as required, after returning from this
function. Any additional windows added to the standard set can be handled by
adding SWP structures to the array, with positions and sizes set as
necessary.
 
See Also
 
WinSetMultWindowPos, RECTL, SWP, WM_UPDATEFRAME