This example uses WinGetMinPosition to determine the minimized position for the window in response to a minimize message (WM_MINMAXFRAME), and then calls WinSetWindowPos to minimize 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_MINIMIZE: fSuccess = WinGetMinPosition(hwnd, pSwp, NULL); WinSetWindowPos(hwnd, 0L, pSwp->x, /* x pos */ pSwp->y, /* y pos */ pSwp->cx, /* x size */ pSwp->cy, /* y size */ SWP_MINIMIZE); /* flags */ break; }