JavaScript Editor js editor     Web development 

Main Page

Releases the specified menu and all its items and frees all memory associated with this menu.

void _DisposeMenu(MENUID menuid)
MENUID menuid;            /* Menu identifier. */


_DisposeMenu(В ) doesn't release any submenus that are associated with the menu.

For more information on how to create an API library and integrate it with Visual FoxPro, see Accessing the Visual FoxPro API.


The following example calls _DisposeMenu(В ) after the user chooses a menu item.

Visual FoxPro Code

В Copy Code

C Code

В Copy Code
#include <pro_ext.h>

void putLong(long n)
   Value val;

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


FAR onSelection(long menuId, long itemId)
   _PutStr("\nitemId = "); putLong(itemId);

FAR activateMenu(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 = 10; loc.h = 20;
   _SetMenuPoint(menuId, loc);

   _OnSelection(menuId, -1, onSelection);

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

See Also

JavaScript Editor js editor     Web development