hWnd Property

Purpose

Returns a handle to a form or control.

Syntax

h = object.hWnd

object:Ocx Object
h:Handle

Description

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.

For the Screen object hWnd returns the handle of the desktop window.

Example

OpenW 1

Print Win_1.hWnd

Remarks

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

See Also

hDC, hDC2

{Created by Sjouke Hamstra; Last updated: 09/10/2014 by James Gaite}