_WHide( ) API Library Routine Example

The following example hides the window whose title is passed as an argument.

Visual FoxPro Code

SET LIBRARY TO WHIDE 
CREATE TABLE X (X C(10))
BROWSE NOWAIT
WAIT WINDOW "Press A Key To Hide Window"
SET LIBR TO WFINDTIT
= WHIDE("X")
WAIT WINDOW "Window Is Hidden"

C Code

#include <pro_ext.h>

void FAR Example(ParamBlk FAR *parm)
{
//   For readability---
#define pTITLE ((char FAR *) _HandToPtr(parm->p[0].val.ev_handle))

   WHANDLE wh;

   if (!_SetHandSize(parm->p[0].val.ev_handle,
      parm->p[0].val.ev_length+ 1))
   {
      _Error(182); // "Insufficient memory"
   }
   _HLock(parm->p[0].val.ev_handle);
   pTITLE[parm->p[0].val.ev_length] = '\0';
   wh = _WFindTitle(pTITLE);
   _HUnLock(parm->p[0].val.ev_handle);
   _WHide(wh);
}
FoxInfo myFoxInfo[] = {
   {"WHIDE", (FPFI) Example, 1, "C"},
};
FoxTable _FoxTable = {
   (FoxTable FAR *) 0, sizeof(myFoxInfo)/sizeof(FoxInfo), myFoxInfo
};