Cancel that request - I have found the relevant messages -
WM_WINDOWPOSCHANGED and WM_SIZE

JohnB

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of John Barrat
Sent: 12 February 2008 10:09
To: 'Borland's Delphi Discussion List'
Subject: RE: How to find the position on the screen of an application

Is it possible to trap an event when a window has been resized or moved? 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Rob Kennedy
Sent: 12 February 2008 00:25
To: Borland's Delphi Discussion List
Subject: Re: How to find the position on the screen of an application

John Barrat wrote:
> I want to be able to track the position and size of a 3rd party 
> application when it is running in on the Windows desktop.
> I guess this can be done through the Windows API, however, some 
> pointers or examples would be useful.

Use GetWindowRect to get the position and dimensions of a window. See also
GetWindowPlacement.

It expects a window handle. A common way of getting a window handle is to
call the FindWindow function, but then you have to know the class name or
window title, and you're also relying on there being only one window
matching those criteria. EnumWindows will give you every top-level window to
let you do more thorough examination to decide whether it's the one you're
after. (For instance, you could call GetWindowThreadProcessID and use the
process ID to determine which process created the window.)

All those functions are documented on MSDN.

--
Rob


_______________________________________________
Delphi mailing list -> [email protected]
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi


_______________________________________________
Delphi mailing list -> [email protected]
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi


_______________________________________________
Delphi mailing list -> [email protected]
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi

Reply via email to