try this piece of code and see if it will work:<br><br>procedure TForm1.GetAWnd(var Wnd: hWnd; var WClassName: string;<br> var WndText: string; var WndOwner: hWnd);<br>begin<br> result:=WindowFromPoint(GetCursorPos);<br> GetClassName(Wnd, pchar(ClassName), 255);<br> GetWindowText(Wnd, pchar(WndText), 255);<br> WndOwner:=GetWindow(Wnd,GW_Owner);<br>end;