<xml> </xml>

SOLIDWORKS PDM Professional API Help | Send Feedback
OnMenuItem2 Method (IEdmMenu7)
See Also Example

Collapse All Expand All Language Filter: All Language Filter: Multiple Language Filter: Visual Basic Language Filter: C# Language Filter: C++/CLI

EPDM.Interop.epdm Namespace > IEdmMenu7 Interface : OnMenuItem2 Method (IEdmMenu7)

Visual Basic
C#
C++/CLI

lItemID
  ID of the selected menu item

lParentWnd
  Parent window handle (HWND)

lCurrentFolderID
  ID of currently active folder

poSelObjects
  List of selected objects (files, folders, items, etc.)

Executes the command for the selected menu item.

# Syntax

Visual Basic |
--- | ---

    Function OnMenuItem2( _
       ByVal lItemID As System.Integer, _
       ByVal lParentWnd As System.Integer, _
       ByVal lCurrentFolderID As System.Integer, _
       ByVal poSelObjects As IEdmSelectionList6 _
    ) As System.Integer

C# |
--- | ---

    System.int OnMenuItem2(
       System.int lItemID,
       System.int lParentWnd,
       System.int lCurrentFolderID,
       IEdmSelectionList6 poSelObjects
    )

C++/CLI |
--- | ---

    System.int OnMenuItem2(
    &   System.int lItemID,
    &   System.int lParentWnd,
    &   System.int lCurrentFolderID,
    &   IEdmSelectionList6^ poSelObjects
    )

#### Parameters

lItemID
  ID of the selected menu item
lParentWnd
  Parent window handle (HWND)
lCurrentFolderID
  ID of currently active folder
poSelObjects
  List of selected objects (files, folders, items, etc.)

#### Return Value

User-interface elements that should be refreshed as defined in EdmRefreshFlag

# Example

Display Menu of Commands (VB.NET)

# Remarks

You should call this method when a user selects a menu item belonging to this menu.

NOTE: This method supersedes IEdmMenu5::OnMenuItem, which only works with files and folders. IEdmMenu7::OnMenuItem2 works with files and folders as well as other object types such as items.

Return codes:

- S_OK: The method successfully executed.
- S_FALSE: Menu item does not belong to this menu.
- S_EDM_MENU_ITEM_NOT_APPLICABLE: The current selection of objects do not satisfy the constraints set by the command author. See EdmMenuFlags sent to IEdmCmdMgr5::AddCmd.

# See Also

####

IEdmMenu7 Interface
IEdmMenu7 Members

# Availability

SOLIDWORKS PDM Professional 2011