Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

_WClearRect( ) API Library Routine

Visual Studio .NET 2003

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

void _WClearRect(WHANDLE wh, Rect r)
WHANDLE wh;            /* Window handle. */
Rect r;                     /* Rectangle to clear. */


The output position is unchanged.

The area of the rectangle extends from the top left coordinate to, but not including, the bottom right coordinate. This means that you should declare the bottom and right coordinates to be one more than the intended size of the rectangle.

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


The following example creates a window and fills it with Xs. After the user presses a key in response to a Visual FoxPro WAIT command, _WClearRect( ) clears a rectangular region of the window.

Visual FoxPro Code


C Code

#include <pro_ext.h>

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

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

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

   r.top    = 2;W
   r.left    = 2;
   r.bottom = 15;
   r.right  = 65;

   _WClearRect(wh, r);

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

See Also

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

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft. All rights reserved.