_SetMenuPointP( ) API Library Routine Example

The following example creates a menu and then activates it at three different screen positions specified by _SetMenuPointP( ).

Visual FoxPro Code

SET LIBRARY TO SETMNPTP

C Code

#include <pro_ext.h>

FAR SetMenuPointPEx(ParamBlk FAR *parm)
{
   MENUID menuId;
   ITEMID itemId;
   Point loc;

   menuId = _GetNewMenuId();
   _NewMenu(MPOPUP, menuId);

   itemId = _GetNewItemId(menuId);
   _NewItem(menuId, itemId, -2, "\\<1st item");

   itemId = _GetNewItemId(menuId);
   _NewItem(menuId, itemId, -2, "\\<2nd item");

   itemId = _GetNewItemId(menuId);
   _NewItem(menuId, itemId, -2, "\\<3rd item");

   loc.v = 40; loc.h = 80;
   _SetMenuPointP(menuId, loc);
   _MenuInteract(&menuId, &itemId);

   loc.v = 80; loc.h = 160;
   _SetMenuPointP(menuId, loc);
   _MenuInteract(&menuId, &itemId);

   loc.v = 160; loc.h = 320;
   _SetMenuPointP(menuId, loc);
   _MenuInteract(&menuId, &itemId);

   _DisposeMenu(menuId);
}

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