The following code illustrates how to size the window to its default size, or the optimum size of the dialog 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*/