Condividi tramite


_DeActivateMenu( ) API Library Routine

Removes a menu from the screen.

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

Remarks

The menu isn't released from memory and can be reactivated with _ActivateMenu( ).

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 activates and deactivates a menu several times.

Visual FoxPro Code

SET LIBRARY TO DEACTMEN

C Code

#include <pro_ext.h>

FAR DeActMenuEx(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);

   _ActivateMenu(menuId);
   _Execute("WAIT WINDOW 'Menu activated'");
   _DeActivateMenu(menuId);
   _Execute("WAIT WINDOW 'Menu deactivated'");
   _ActivateMenu(menuId);
   _Execute("WAIT WINDOW 'Menu activated'");
   _DeActivateMenu(menuId);
   _Execute("WAIT WINDOW 'Menu deactivated'");

   _DisposeMenu(menuId);
}

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

See Also

_ActivateMenu( ) API Library Routine | Accessing the Visual FoxPro API | DEACTIVATE MENU Command | ACTIVATE MENU Command | HIDE MENU Command