_WSetTitle( ) API Library Routine Example

The following example creates a window and defines its title text with _WSetTitle( )

Visual FoxPro Code

SET LIBRARY TO WSETTITL

C Code

#include <pro_ext.h>

FAR Example(ParamBlk FAR *parm)
{
   WHANDLE wh;
   char FAR *buffer;

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

   _WSetTitle(wh, "This is a window title");

   _WShow(wh);

   if ((buffer = _Alloca(128)) == 0)
   {
      _Error(182); // "Insufficient memory"
   }
   _WTitle(wh, buffer);

   _PutStr("\nThe window title is \"");
   _PutStr(buffer);
   _PutChr('"');


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