RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TWinControl.GetTopParentHandle Method

Returns the window handle of the first window not associated with a VCL control that contains the windowed control.

Pascal
function GetTopParentHandle: HWnd;
C++
__fastcall HWnd GetTopParentHandle();

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. 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!