Share via


_WClear( ) API Library Routine

Erases the contents of the specified window by changing the content area to the default background color.

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

Remarks

The logical cursor position is unchanged.

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 a window and fills it with Xs. When the user presses a key in response to a Visual FoxPro WAIT command, _WClear( ) clears the window.

Visual FoxPro Code

SET LIBRARY TO WCLEAR  

C Code

#include <pro_ext.h>

FAR WClearEx(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);

   for (row = 0; row < _WHeight(wh); row++)
   {
      for (col = 0; col < _WWidth(wh); col++)
      {
         _WPutChr(wh, 'X');
      }
      _WPutChr(wh, '\n');
   }
   _Execute("WAIT WINDOW 'Press any key to clear window'");
   _WClear(wh);
}

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

See Also

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