_WSelect( ) API Library Routine Example

The following example creates five overlapping windows. The windows are each moved to the frontmost position using _WSelect( ), starting with the first window created.

Visual FoxPro Code

SET LIBRARY TO WSELECT 

C Code

#include <pro_ext.h>

FAR WSelectEx(ParamBlk FAR *parm)
{
   WHANDLE wh[5];
   int i;

   for (i = 0; i < 5; i++)
   {
      wh[i] = _WOpen(4 + 2*i,4 + 2*i,12 + 2*i,40 + 2*i,WEVENT | CLOSE,
         WINDOW_SCHEME, (Scheme FAR *) 0, WO_SYSTEMBORDER);
      _WShow(wh[i]);
   }
   for (i = 0; i < 5; i++)
   {
      _Execute("WAIT WINDOW 'Press key to _WSelect() next window'");
      _WSelect(wh[i]);
   }
}

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