Toolbar_GetIndexFromMenu

int Toolbar_GetIndexFromMenu (ToolbarType toolbar, int menuItem, int *index);

Purpose

Searches for an item on the toolbar that is associated with a particular menu item. You can use this function if your toolbar items use menu callbacks and you need to access the corresponding toolbar items in the menu callbacks.

Parameters

Input
Name Type Description
toolbar ToolbarType The specifier for the toolbar.

Obtain this handle from the Toolbar_New or Toolbar_Duplicate functions.
menuItem integer The menu item to search for. You can obtain this handle from NewMenuItem or in the .uir header file.
Output
Name Type Description
index integer * Returns the index of the first toolbar item with the specified menu item or –1 if no matching item is found.

Return Value

Name Type Description
status integer Return value indicating whether the function was successful. A negative number indicates that an error occurred.