Share via


_WZoom( ) API Library Routine

Minimizes or maximizes the specified window, or returns it to normal.

void _WZoom(WHANDLE wh, int newstate)
WHANDLE wh;            /* Window handle. */
int newstate;                  /* State of window after zoom. */

Remarks

You can specify the newstate parameter as WZ_MINIMIZE, WZ_NORMAL, or WZ_MAXIMIZE, which are defined in the PRO_EXT.H file.

For more information on how to create an API library and integrate it with Visual FoxPro, see Accessing the Visual FoxPro API.

Example

The following example creates and displays a window. It then calls _WZoom( ) for this window with each possible parameter.

Visual FoxPro Code

SET LIBRARY TO WZOOM 

C Code

#include <pro_ext.h>

FAR Example(ParamBlk FAR *parm)
{
   WHANDLE wh;
   int row, col;

   wh = _WOpen(2,2,20,70,WEVENT | CLOSE,WINDOW_SCHEME,(Scheme FAR *) 0,
      WO_SYSTEMBORDER);

   _WShow(wh);

   _Execute("WAIT WINDOW 'Press any key to minimize window'");
   _WZoom(wh, WZ_MINIMIZED);

   _Execute("WAIT WINDOW 'Press any key to normalize window'");
   _WZoom(wh, WZ_NORMAL);

   _Execute("WAIT WINDOW 'Press any key to maximize window'");
   _WZoom(wh, WZ_MAXIMIZED);

   _Execute("WAIT WINDOW 'Press any key to normalize window'");
   _WZoom(wh, WZ_NORMAL);
}

FoxInfo myFoxInfo[] = {
   {"ONLOAD", (FPFI) Example, CALLONLOAD, ""},
};
FoxTable _FoxTable = {
   (FoxTable FAR *) 0, sizeof(myFoxInfo)/sizeof(FoxInfo), myFoxInfo
};

See Also

_WMove( ) API Library Routine | _WSize( ) API Library Routine | _WShow( ) API Library Routine | Accessing the Visual FoxPro API | ZOOM WINDOW Command