Click or drag to resize

GetObjectByHandle Function

X#
Return the object associated with a given window handle.

Namespace:  VOGUIClasses
Assembly:  VOGUIClasses (in VOGUIClasses.dll) Version: 2.19
Syntax
 FUNCTION GetObjectByHandle(
	hwnd AS PTR
) AS Object
Request Example View Source

Parameters

hwnd
Type: Void*
The window handle.

Return Value

Type: Object
The Window or Control object associated with the given window handle.
Remarks
Examples
This example gets the object associated with the control that currently has focus:
X#
1FUNCTION GetFocusedObject() AS OBJECT
2LOCAL oCtrl AS OBJECT
3oCtrl := GetObjectByHandle(GetFocus())
4IF IsInstanceOf(oCtrl, #Control)
5RETURN oCtrl
6ELSE
7RETURN NULL_OBJECT
8ENDIF
See Also