[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'Controls' (#lcl)

# TWinControl.GetTopParentHandle

Gets the window handle for the parent control at the top of the control hierarchy.

## Declaration

Source position: controls.pp line 2248

`protected function TWinControl.GetTopParentHandle: HWND;`

## Function result

Window handle for the top-most parent control in the hierarchy.

## Description

GetTopParentHandle is a HWND function used to get the window handle for the first control in the parent control hierarchy. The value in Parent is recursively searched until Parent is not assigned.

The return value is the ParentWindow property in the top-most control. If ParentWindow is 0 (the unassigned value), the value in its Handle property is used.