Installs a callback procedure for handling the add-on’s menu commands.
GSErrCode ACAPI_Install_MenuHandler ( short menuStrResID, APIMenuCommandProc* handlerProc );
Parameters
- menuStrResID
- [in] An identifier of the menu to install the callback procedure for. This should be the same what you used in the ACAPI_Register_Menu as a menu string resource number in the RegisterInterface function.
- handlerProc
- [in] The callback function to handle the menu commands.
Return Values
NoError
- The function has completed with success.
For other common API errors see the API Errors document.
Remarks
This function should be called in the Initialize function of your add-on. It installs the callback function which is called when the user chooses one of your menu commands.
Example
// ----------------------------------------------------------------------------- // Called when the add-on has been loaded into memory // ----------------------------------------------------------------------------- GSErrCode __ACENV_CALL Initialize (void) { GSErrCode err = NoError; err = ACAPI_Install_MenuHandler (32500, APIMenuCommandProc); return err; } // Initialize
Requirements
- Version: API 4.1 or later
- Header: ACAPinc.h