An application can maximize, minimize, or restore a frame window by using the WinSetWindowPos function and specifying the constant SWP_MAXIMIZE, SWP_MINIMIZE, or SWP_RESTORE. Only a frame window can maximize and minimize by default. For any other window, an application must provide support for these actions in the corresponding window procedure.
The following figure shows how to maximize a frame window.
SWP swpCurrent; HWND hwndFrame; WinQueryWindowPos(hwndFrame, &swpCurrent); WinSetWindowPos( hwndFrame, /* Window handle */ NULL, /* Not used to maximize */ swpCurrent.x, swpCurrent.y, /* Stored for restoring window */ swpCurrent.cx, swpCurrent.cy, /* Stored for restoring window */ SWP_MAXIMIZE | SWP_SIZE | SWP_MOVE); /* Maximize */