_WClose( ) API Library Routine

Closes the specified window and releases all memory associated with the window.

void _WClose(WHANDLE wh)
WHANDLE wh;            /* Window handle. */

Remarks

If the window is displayed on the screen, _WClose( ) removes it from the screen.

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. After the user presses a key in response to a Visual FoxPro WAIT command, _WClose( ) closes the window.

Visual FoxPro Code

SET LIBRARY TO WCLOSE  

C Code

#include <pro_ext.h>

FAR Ex(ParamBlk FAR *parm)
{
   WHANDLE wh;
   int row, col;
   Rect r;

   wh = _WOpen(2, 2, 20, 70, 0, WINDOW_SCHEME, (Scheme FAR *) 0,
      WO_SYSTEMBORDER);
   _WShow(wh);
   _Execute("WAIT WINDOW 'Press any key to close window'");
   _WClose(wh);
}

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

See Also

_WOpen( ) API Library Routine | WAIT Command | Accessing the Visual FoxPro API