IWCContextMenuCallback::AddExtensionMenuItem method (cluadmex.h)
[This method is available for use in the operating systems specified in the Requirements section. Support for this method was removed in Windows Server 2008.]
Adds a menu item to a Failover Cluster Administrator context menu.
Syntax
HRESULT AddExtensionMenuItem(
[in] BSTR lpszName,
[in] BSTR lpszStatusBarText,
[in] ULONG nCommandID,
[in] ULONG nSubmenuCommandID,
[in] ULONG uFlags
);
Parameters
[in] lpszName
Pointer to a null-terminated Unicode string containing the name of the item to be added to the menu. Although declared as a BSTR, this parameter is implemented as an LPWSTR.
[in] lpszStatusBarText
Pointer to text to display on the status bar when the new item is selected. Although declared as a BSTR, this parameter is implemented as an LPWSTR.
[in] nCommandID
Identifier for the command to be invoked when the menu item is selected. The nCommandID parameter must not be set to –1.
[in] nSubmenuCommandID
Identifier for a submenu. Submenus are not supported, and the nSubmenuCommandID parameter must be zero.
[in] uFlags
Bitmask of flags that describes the new menu item. One or more of the following values may be set.
MF_CHECKED (8)
Acts as a toggle with MF_UNCHECKED to place the default check mark next to the item.
MF_UNCHECKED (0)
Acts as a toggle with MF_CHECKED to remove a check mark placed next to the item.
MF_DISABLED (2)
Disables the menu item so it cannot be selected but does not dim it.
MF_ENABLED (0)
Enables the menu item so it can be selected and restores it from its dimmed state if the item was previously dimmed.
MF_GRAYED (1)
Disables the menu item so it cannot be selected and dims it.
MF_MENUBARBREAK (32 (0x20))
Places the item in a new column. The new column is separated from the old column by a vertical dividing line.
MF_MENUBREAK (64 (0x40))
Places the item in a new column. No dividing line is placed between the columns.
MF_SEPARATOR (2048 (0x800))
Draws a horizontal dividing line. This line cannot be dimmed, disabled, or highlighted. The lpszName and lpszStatusBarText parameters are ignored.
MF_STRING (0)
Specifies that the menu item is a character string. The lpszName parameter contains a pointer to a NULL-terminated Unicode string. This is the default interpretation.
Return value
If AddExtensionMenuItem is not successful, it can return other HRESULT values.
Return code/value | Description |
---|---|
|
The operation was successful. |
|
The uFlags parameter was set to either MF_OWNERDRAW or MF_POPUP. |
|
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.
Failover Cluster Administrator extensions call AddExtensionMenuItem from their IWEExtendContextMenu::AddContextMenuItems method.
Requirements
Requirement | Value |
---|---|
Minimum supported client | None supported |
Minimum supported server | Windows Server 2003 Enterprise, Windows Server 2003 Datacenter |
Target Platform | Windows |
Header | cluadmex.h |