SOLIDWORKS PDM Professional API Help Send Feedback
OnMenuItem2 Method (IEdmMenu7)
See Also  Example
EPDM.Interop.epdm Namespace > IEdmMenu7 Interface : OnMenuItem2 Method (IEdmMenu7)


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

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

Availability

SOLIDWORKS PDM Professional 2011