Ähm...
Delphi-Quellcode:
{ Find a TWinControl given a window handle }
{ The global atom table is trashed when the user logs off. The extra test
below protects UI interactive services after the user logs off.
Added additional tests to enure that Handle is at least within the same
process since otherwise a bogus result can occur due to problems with
GlobalFindAtom in Winapi.Windows. }
function FindControl(
Handle: HWnd): TWinControl;
Zielführender wäre hier vielleicht
function FindGlobalComponent(const Name: string): TComponent;