GetMenuItems
HRESULT
GetMenuItems(long layer_handle, long object_handle,
BSTR FAR* menu_text);
When a layer object is right-clicked in FalconView, FV tries to call GetMenuItems. The items found in menu_text are displayed in a right-click context menu.
Parameters
|
layer_handle |
the value of the handle to the layer |
|
|
|
|
object_handle |
the value of the object that needs the menu items |
|
|
|
|
menu_text |
a pointer to a BSTR used to receive the menu items and callbacks |
Returns
S_OK (success)
For failure, a variety of standard HRESULT values can be returned. Consult your COM documentation for these standard values.
Remarks
menu_text should contain the menu text for an item followed by a callback for that menu item. The '\n' character should separate each of the items in the list. For example, if you wish to add the menu items "Edit" and "Properties…" with the callback method names Edit and Properties, respectively, then menu_text should look like the following:
"Edit\nEdit\nProperties…\nProperties"
When the menu item is selected, the appropriate callback function would be called with the layer and the object handles as parameters. For example, if the user right-clicked an object and selected Properties…, then FalconView calls the client callback's method Properties (long layer_handle, long object_handle).
-- ChrisBailey - 01 May 2007
---
-- Scott Marshall - 22 Feb 2007
A) To nest a menu item in GetMenuItems use the '\\' character as a separator in the menu name. Nesting in this manner only works a single level deep. For your example, you would pass back the string:
"Airway\\Info\nOnAirwayInfo\nAirway\\Hide\nOnAirwayHide"
There is currently no way to nest items more than one level deep.
