This document is archived and information here might be outdated.  Recommended version.


IToolbarMenu.SetHook Method (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Controls > ESRI ArcGIS Controls > Interfaces > IT > IToolbarMenu Interface > IToolbarMenu.SetHook Method
ArcGIS Developer Help

IToolbarMenu.SetHook Method

Sets the object that is passed as a hook to the OnCreate event of each item's command.

[Visual Basic .NET]
Public Sub SetHook ( _
    ByVal pHook As Object _
)
[C#]
public void SetHook (
    object pHook
);
[C++]
HRESULT SetHook(
  IDispatch* pHook
);
[C++]
Parameters
pHook [in]

pHook is a parameter of type IDispatch

Product Availability

Available with ArcGIS Engine.

Description

The Hook is a shortcut to ICommandPoolEdit::Hook on the CommandPool. If the ToolbarMenu is an item on the ToolbarControl the Hook is shared and initialized by the ToolbarControl. If the ToolbarMenu is a standalone popup menu use the SetHook method, and optionally share the CommandPool with an existing one within the application.

See Also

IToolbarMenu Interface

.NET Samples

Using HookActions in custom commands Save a layer file in a MapControl application Building a MapViewer application using the ArcGIS Engine controls ArcGIS Network Analyst extension Engine application Schematics Engine application Displaying a TOCControl context menu Creating toolbar menus that work with the ToolbarControl