ddr4lyfe Posted August 23, 2013 Share Posted August 23, 2013 I'm trying to move Window1 to the center of Window2 using Window2's size as a reference, something like: While WinExists ("Window1") WinMove ("Window1", "", $Window2Width / 2, $Window2Height / 2) WEnd I could just move Window1 by using desktop coordinates, but I'm looking for a nicer solution. Any ideas? Link to comment Share on other sites More sharing options...
Solution somdcomputerguy Posted August 23, 2013 Solution Share Posted August 23, 2013 Use WinGetPos() to get the size of Window2. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
ddr4lyfe Posted August 23, 2013 Author Share Posted August 23, 2013 Use WinGetPos() to get the size of Window2. Oh wait... that would work because it would be grabbing the position using the desktop coords, then would move Window1 to those same desktop coords. So instead of moving Window1's coords using Window2 as a reference, both windows just use the desktop as a reference. Alright, thanks for the help! Link to comment Share on other sites More sharing options...
somdcomputerguy Posted August 23, 2013 Share Posted August 23, 2013 (edited) WinGetPos() returns a 4 element array - window position X & Y, window size width & height. See the Help file for details. The WinGetClientSize() function may be useful instead.. Edited August 23, 2013 by somdcomputerguy - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now