Vcl.Controls.TWinControl.GetTopParentHandle
Delphi
function GetTopParentHandle: HWnd;
C++
HWND __fastcall GetTopParentHandle();
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | protected | Vcl.Controls.pas Vcl.Controls.hpp |
Vcl.Controls | TWinControl |
Description
Returns the window handle of the first window not associated with a VCL control that contains the windowed control.
Use GetTopParentHandle to access the handle of the window that is hosting the windowed control. GetTopParentHandle walks up the containers of the windowed control until it finds a control whose Parent property is nil (Delphi) or NULL (C++). If that topmost parent is contained in a non-VCL window (its ParentWindow is nonzero), GetTopParentHandle returns the non-VCL window. If the windowed control is not contained in a non-VCL window, GetTopParentHandle returns the windowed control's own window handle.