JavaScript Editor js editor     Web development 

Main Page

Returns the current output position in the specified window.

Point _WGetCursor(WHANDLE wh)
WHANDLE wh;            /* Window handle. */


The following example creates a window and draws a diagonal pattern of Xs in this window. It positions the cursor before writing each X using _WPosCursor(В ), and gets that same position using _WGetCursor(В ).

Visual FoxPro Code

В Copy Code

C Code

В Copy Code
#include <pro_ext.h>

void putLong(long n, int width)
   Value val;

   val.ev_type = 'I';
   val.ev_long = n;
   val.ev_width = width;


FAR Example(ParamBlk FAR *parm)
   WHANDLE wh;
   Point putPos, getPos;

   wh = _WOpen(4,4,20,70,0,WINDOW_SCHEME,(Scheme FAR *) 0,

   for (putPos.v = 2; putPos.v < 14; putPos.v++)
      putPos.h = putPos.v;

      _WPosCursor(wh, putPos);
      getPos = _WGetCursor(wh);
      _WPutChr(wh, 'X');

      _PutStr("\nCursor position:");
      putLong(getPos.v, 5);
      putLong(getPos.h, 5);

      _Execute("WAIT WINDOW");

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

See Also

JavaScript Editor js editor     Web development