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

IToolControl.hWnd Property (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > SystemUI > ESRI.ArcGIS.SystemUI > Interfaces > IT > IToolControl Interface > IToolControl.hWnd Property
ArcGIS Developer Help

IToolControl.hWnd Property

The handle of the control.

[Visual Basic .NET]
Public ReadOnly Property hWnd As Integer
public int hWnd {get;}
HRESULT get_hWnd(
hWnd [out, retval]

hWnd is a parameter of type OLE_HANDLE*

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.


When implementing IToolControl to create a custom tool, use the hWnd property to pass window handle of the control to the application.

For example, if you want your ToolControl to be a simple ComboBox control, put a ComboBox control on a form and then pass the hWnd of the ComboBox control to the ToolControl. If you want you ToolControl to be more complex such as a ComboBox with a label, you can put the ComboBox and Label in a Frame control or PictureBox control, and then pass the hWnd of the Frame or PictureBox to the ToolControl.

Only one instance of a ToolControl can exist within an application framework at any give time. This
is because the hWnd property is passed a window handle to the control. To prevent a user from dragging two instances of a ToolControl into an application framework set the ICommand::Category property to an empty string. This will prevent the ToolControl from appearing in the customzie dialog.

See Also

IToolControl Interface