Jump to content

WinInsertDefaultSize

From EDM2

This function adds the default size function to the system menu of a secondary window.

Syntax

#define INCL_SW
#include <os2.h>

HWND    hwnd;            /*  Secondary window handle. */
PSZ     pszDefaultSize;  /*  Text for system menu. */
BOOL    rc;              /*  Return codes. */

rc = WinInsertDefaultSize(hwnd, pszDefaultSize);

Parameters

hwnd (HWND) - input
Secondary window handle.
pszDefaultSize (PSZ) - input
Text to be inserted into the system menu. Usually, this will read 'Default Size'.

Return Value

rc (BOOL) - returns
Return codes indicating success or failure:
  • TRUE: Success.
  • FALSE: Failure or not recognized.

Remarks

The function adds Default Size to the system menu of a secondary window. Because a secondary window is a sizable dialog, its initial size is the optimal size for the dialog. After the window is sized, scroll bars appear when necessary. The default size function returns the window to its optimal size.

Example Code

The following code illustrates adding the default size function to the system menu of a secondary window.

#define INCL_SW
#include <os2me.h>

HWND hwndFrame;

hwndFrame = WinLoadSecondaryWindow (HWND_DESKTOP, /* Parent window   */
                                    HWND_DESKTOP, /* Owner window    */
                                    MyDlgProc,    /* Dialog procedure*/
                                    NULL,         /* Module handle   */
                                    ID_DIALOG,    /* Resource ID     */
                                    NULL);        /* Create parameter*/

WinInsertDefaultSize (hwndFrame, "~Default size"); /* Insert menu item */
WinDefaultSize (hwndFrame);      /* Set window to its default size */

Related Functions