hWnd Property

       

Returns a handle to a form or control.

Note   This property is not supported for the OLE container control.

Syntax

object.hWnd

The object placeholder represents an object expression that evaluates to an object in the Applies To list.

Remarks

The Microsoft Windows operating environment identifies each form and control in an application by assigning it a handle, or hWnd. The hWnd property is used with Windows API calls. Many Windows operating environment functions require the hWnd of the active window as an argument.

Note   Because the value of this property can change while a program is running, never store the hWnd value in a variable.

If the Windowless property of a User Control is set to True, the hWnd property will return 0.