IWCContextMenuCallback::AddExtensionMenuItem
The IWCContextMenuCallback::AddExtensionMenuItem method adds a menu item to a Cluster Administrator context menu.
HRESULT AddExtensionMenuItem(
BSTR lpszName,
BSTR lpszStatusBarText,
ULONG nCommandID,
ULONG nSubmenuCommandID,
ULONG uFlags
);
Parameters
-
lpszName
-
[in] Pointer to the name of the item to be added to the menu.
-
lpszStatusBarText
-
[in] Pointer to text to display on the status bar when the new item is selected.
-
nCommandID
-
[in] Identifier for the command to be invoked when the menu item is selected. The nCommandID parameter must not be set to –1.
-
nSubmenuCommandID
-
[in] Identifier for a submenu. At present, submenus are not supported and the nSubmenuCommandID parameter must be zero.
-
uFlags
-
[in] Bitmask of flags that describes the new menu item. One or more of the following values may be set:
-
MF_CHECKED
-
Acts as a toggle with MF_UNCHECKED to place the default check mark next to the item.
-
MF_UNCHECKED
-
Acts as a toggle with MF_CHECKED to remove a check mark placed next to the item.
-
MF_DISABLED
-
Disables the menu item so it cannot be selected but does not dim it.
-
MF_ENABLED
-
Enables the menu item so it can be selected and restores it from its dimmed state.
-
MF_GRAYED
-
Disables the menu item so it cannot be selected and dims it.
-
MF_MENUBARBREAK
-
Places the item in a new column. The new column will be separated from the old column by a vertical dividing line.
-
MF_MENUBREAK
-
Places the item in a new column. No dividing line is placed between the columns.
-
MF_SEPARATOR
-
Draws a horizontal dividing line. This line cannot be dimmed, disabled, or highlighted. The lpszName and lpszStatusBarText parameters are ignored.
-
MF_STRING
-
Specifies that the menu item is a character string. The lpszName parameter contains a pointer to a null-terminated string. This is the default interpretation.
Return Values
-
NOERROR
-
The operation was successful.
-
E_INVALIDARG
-
The uFlags parameter was set to either MF_OWNERDRAW or MF_POPUP.
-
E_OUTOFMEMORY
-
There was an error allocating the menu item.
Remarks
The AddExtensionMenuItem method adds items at the top of the context menu and follows them by a separator. The command identified by nCommandID is passed in the nCommandID parameter to the IWEInvokeCommand::InvokeCommand method when the user selects this menu item.
Note that the MF_OWNERDRAW and MF_POPUP flags are not supported specifically for the uFlags parameter.
Cluster Administrator extensions call AddExtensionMenuItem from their IWEExtendContextMenu::AddContextMenuItems method.
QuickInfo
Version: Use Windows NT Server Enterprise Edition 4.0.
Windows CE: Unsupported.
Header: Declared in cluadmex.h.