Share via


_WSetTitle( ) API Library Routine

Changes the title of the specified window to title.

void _WSetTitle(WHANDLE wh, char FAR *title)
WHANDLE wh;            /* Window handle. */
char FAR *title;            /* Window title. */

Remarks

To remove a title from a window, pass (char FAR *)0 as the new title.

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 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
};

See Also

_WFindTitle( ) API Library Routine | _WTitle( ) API Library Routine | _WShow( ) API Library Routine | Accessing the Visual FoxPro API