APIIo_​GetMenuItemFlagsID

Returns the flag values of the specified menu item mounted by API tool add-on.

    GSErrCode ACAPI_Interface (
        APIIo_GetMenuItemFlagsID,
        const API_MenuItemRef*     menuItemRef,
        GSFlags                    itemFlags
    );

 

Parameters

menuItemRef
[in] Identifies the menu item.
itemFlags
[out] Menu item flags.

Flag Value

Meaning

API_MenuItemDisabled

The menu item is currently disabled

API_MenuItemChecked

The menu item is currently checked

 

Return Values

NoError
The function has completed with success.
APIERR_BADPARS
any of the parameters are nullptr
APIERR_BADINDEX
the specified menu item does not belong to the caller add-on

For other common API errors see the API Errors document.

 

Remarks

This function is used to get the current status of a menu item which belongs to the caller API tool add-on. The menu item is referenced with the resource ID and the string number.

To change the status of a menu item use the APIIo_SetMenuItemFlagsID function.

 

Example


void    EnableACMenuItem (short itemInd, bool enable)
{
    API_MenuItemRef itemRef;
    GSFlags         itemFlags;

    BNZeroMemory (&itemRef, sizeof (API_MenuItemRef));
    itemRef.menuResID = 32500;
    itemRef.itemIndex = itemInd;

    itemFlags = 0;
    ACAPI_Interface (APIIo_GetMenuItemFlagsID, &itemRef, &itemFlags);
    if (enable)
        itemFlags &= ~API_MenuItemDisabled;
    else
        itemFlags |= API_MenuItemDisabled;
    ACAPI_Interface (APIIo_SetMenuItemFlagsID, &itemRef, &itemFlags);

    return;
}       // EnableACMenuItem

 

Requirements

Version: API 2.1 or later
Header: APIdefs_Interface.h

 

See Also

API_MenuItemRef,
APIIo_SetMenuItemFlagsID,
ACAPI_Interface, API Functions