[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do I get the current location of a window?



In article <uerics.726388359@mcl> uerics@mcl.ucsb.edu (Eric D. Shepherd)
writes:
>As far as I can tell, there is no way to get the current X,Y position of
>the upper-right hand corner of the window.  I want to be able to get that
>position so that I can later feed it into MoveWindow (I'm writing a Finder
>Extension, and want the window's position to be preserved between uses).
>
>Any suggestions?

Set the current port to the window's port, call GetPortRect, and process
the upper-left-hand point of the rectangle with LocalToGlobal.  This
point will now contain the global coordinates of the window's upper-left
corner, which can later be used with MoveWindow.

Check out the WinFlate source for an example of this.

Jason Simmons
jsimmons@sbcs.sunysb.edu