_WClose( ) API Library Routine 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
};