Description of QueryContextMenu flags

Add SHORT DESCRIPTION.

iSeries™ Navigator supports the following enhancements to the IContextMenu interface:

Ordering of context menu items
The iSeries Navigator has extended the IContextMenu interface to obtain more precise control over the order in which menu items are added to the menu for a particular folder or object. The Navigator structures its context menus in three sections. This structure ensures that when more than one component adds items to the context menu for an object, the items will still appear in the correct order that is defined for the Windows® user interface.

The first section contains actions which are specific to the object type, such as Reorganize for a database table. The second section contains "object creation" items; these items are object types which cascade off of a New menu item. Lastly there are the so-called "standard" Windows menu items, such as Delete or Properties. You may choose to add menu items to any section of the context menu.

The iSeries Navigator calls the QueryContextMenu method for a component three times in succession, once for each section of the menu. The following additional flags are defined in the uFlags parameter to allow you to determine which section of the context menu is currently being serviced.

UNITY_CMF_CUSTOM
This flag indicates that you should add object-specific actions to the menu.
UNITY_CMF_NEW
This flag indicates that you should add object creation items to the menu.
UNITY_CMF_STANDARD
This flag indicates that you should add standard actions to the menu.
UNITY_CMF_FILEMENU

This flag changes UNITY_CMF_STANDARD. It indicates construction of the File menu pull down for your object, as opposed to the menu that is displayed when the user clicks on an object with mouse button 2.

Items on the File pull down are arranged slightly differently. If you add Properties to the menu, you should avoid inserting a separator as is normally done before this item. Also, edit actions such as Copy or Paste should not be added to the File menu, because they appear on the Edit pull down instead. (The iSeries Navigator calls your shell plug-in at the appropriate time to obtain the items for the Edit menu, and does not set UNITY_CMF_FILEMENU).

Unique property dialogs

In certain cases, a plug-in may desire to implement a Properties context menu item that is defined for one of its own object types as a standard Windows dialog instead of a property sheet. A flag that is defined for this situation may be returned to the Navigator on calls to IContextMenu::QueryContextMenu when the UNITY_CMF_STANDARD flag is set. This flag, A4HYF_INFO_PROPERTIESADDED, should be OR'd with the HRESULT value that is returned by QueryContextMenu.

Returning this flag means that automatic processing for Properties is not performed. In this case, the plug-in must add the context menu item and construct the associated dialog.

Related concepts
Property pages for a property sheet handler