Condividi tramite


_WFindTitle( ) API Library Routine

Returns the WHANDLE of the window with the specified title.

WHANDLE _WFindTitle(TEXT *title)
TEXT *title;               /* Window title. */

Example

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

Visual FoxPro Code

SET LIBRARY TO WFINDTIT
CREATE TABLE X (X C(10))
BROWSE NOWAIT
SET LIBR TO WFINDTIT
= WHIDE("X")

C Code

#include <pro_ext.h>

void FAR WFindTitleEx(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) WFindTitleEx, 1, "C"},
};
FoxTable _FoxTable = {
   (FoxTable FAR *) 0, sizeof(myFoxInfo)/sizeof(FoxInfo), myFoxInfo
};

See Also

Reference

_WSetTitle( ) API Library Routine

_HUnLock( ) API Library Routine

_WHide( ) API Library Routine

_WTitle( ) API Library Routine

Other Resources

API Library Construction