MngrAddMenuItemEx( MenuNo As Integer, MenuText As String, Accelerator As String, Visible As Boolean, Enabled As Boolean, HandlerToPlugin As Object, EventHandlerMethodName As String) As Long

Application object (Manager)

Adds a command for a the supplied plug-in. The new command appears last on the MenuNo pop-up menu. Up to 32 plug-in commands can be added. When the command is selected, the corresponding EventHandlerMethodName method is called on the supplied plug-in HandlerToPlugin.

The return value of this method is the command number that the command got. Use this command number if you want to alter the command, for example disable it.

If the command could not be added, – 1 is returned.

A command added with this method is only used by the plug-in that added the command. No other plug-in can replace the command. Using the MngrAddMenuItem method there is always a risk that another plug-in uses the same command. Which might end up with a mysterious behavior.

Parameters

Parameter

Description

MenuNo

Specifies which existing popup menu the command will be placed in. Note that menu enumeration starts on 0.

MenuText

Specifies the text that is to appear on the menu.

Accelerator

Specifies which accelerator triggers the event. (See list of valid accelerators.) The string for Accelerator must be in CAPITAL letters. For the moment this is not implemented, so just supply an empty string as the accelerator, i.e. no accelerator.

Visible

Specifies whether the command is to be visible or invisible.

Enabled

Specifies whether the command is to be enabled or disabled ("grayed out").

HandlerToPlugin

Is a handle to your plug-in module.

EventHandlerMethodName

Is the method in your plug-in module to call when the command is selected.

Note

Adding an Accelerator to this command is not implemented.

This method is only useful for so called plug-ins or extensions.

XxxxAddMenuItem

Methods for modifying and adding menus and accelerators connected to user-defined events

Methods for the Application object for use with the Manager