This example uses WinGetMaxPosition to determine the maximized position for the window in response to a maximize message (WM_MINMAXFRAME), and then calls WinSetWindowPos to maximize the window to that position.

#define INCL_WINFRAMEMGR        /* Window Frame Functions       */
#include <os2.h>

BOOL  fSuccess;         /* Success indicator                    */
HWND  hwnd;             /* window handle                        */
MPARAM  mpParam1;       /* Parameter 1 (window position)        */
PSWP   pSwp;            /* Set window position structure        */

case WM_MINMAXFRAME:
     pSwp = (PSWP)PVOIDFROMMP(mpParam1);

     switch(pSwp->fl)
        {
        case SWP_MAXIMIZE:
             fSuccess = WinGetMaxPosition(hwnd, pSwp);

             WinSetWindowPos(hwnd, 0L,
                 pSwp->x,             /* x pos  */
                 pSwp->y,             /* y pos  */
                 pSwp->cx,            /* x size */
                 pSwp->cy,            /* y size */
                 SWP_MAXIMIZE);       /* flags */
             break;
        }


[Back] [Next]