ContextCommand Function

This function is called when a user selects one of the entries in a custom shortcut menu.

Syntax

ContextCommand ( int commandId )

Parameter Description
commandId Indicates which command was selected, which the function can use to determine which actions to perform.

To find out which library items are selected when this function is called, refer to the caretEntry parameter of the ContextGetMenuTitle function.

Example (Visual C#)

The following Visual C# example implements the ContextCommand function:

public void ContextCommand(int commandId)
{
    if (commandId == cmd1)
    {
        //Code for first command
        MessageBox.Show("Command 1 selected");
    }
    if (commandId == cmd2)
    {
        //Code for second command
        MessageBox.Show("Command 2 selected");
    }
}