Go Back   Wiki NewForum | Latest Entertainment News > Career Forum & Tips > Tech Forum & Tutorial > Oracle Database, SQL, Application, Programming


What's the name of the Window at x,y?


Reply
Views: 1165  
Thread Tools Rate Thread
  #1  
Old 08-09-2010, 12:47 PM
bholas bholas is offline
Award Winner
 
Join Date: Apr 2010
Posts: 4,977
Default What's the name of the Window at x,y?

If you have a need to find out the name of the parent window of a window or control at a given X and Y position, you maybe able to use the following "GetParentWindowNameAt()" function:
function GetParentWindowNameAt
( X, Y : integer ) : string;
var
P : TPoint;
W : TWinControl;
begin
P.X := X;
P.Y := Y;

W := FindVCLWindow( P );
if( nil <> W )then
begin
Result := W.Name;
end else
begin
Result := '';
end;
end;
Listing #1 : Delphi code. Download winname (0.3 KB).


For example, to get the name of the parent (bottom most window) at (250,300) to a string variable named "strName"
strName :=
GetParentWindowNameAt( 250, 300 );
Listing #2 : Delphi code. Download demo1 (0.17 KB).

Reply With Quote
Reply

Tags
programming tips

New topics in Oracle Database, SQL, Application, Programming





Powered by vBulletin® Version 3.8.10
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
WikiNewForum)