willichan Posted September 10, 2014 Share Posted September 10, 2014 I am having an interesting problem with WinMove() when moving multiple windows. Running this code WinMove("Session A - [24 x 80]", "", 170, 80, 735, 413, 1) WinMove("Session B - [24 x 80]", "", 915, 80, 735, 413, 1) WinMove("Session C - [24 x 80]", "", 170, 480, 735, 413, 1) WinMove("Session D - [24 x 80]", "", 915, 480, 735, 413, 1) both moves AND resizes the first window, but only moves the remaining windows without resizing them. I tried interjecting a Sleep(100) between each WinMove() call, but no change in behavior. However, if I double up the calls, Global $a $a = WinMove("Session A - [24 x 80]", "", 170, 80, 735, 413, 1) If $a <> 0 Then WinMove("Session A - [24 x 80]", "", 170, 80, 735, 413, 1) WinMove("Session B - [24 x 80]", "", 915, 80, 735, 413, 1) If $a <> 0 Then WinMove("Session B - [24 x 80]", "", 915, 80, 735, 413, 1) WinMove("Session C - [24 x 80]", "", 170, 480, 735, 413, 1) If $a <> 0 Then WinMove("Session C - [24 x 80]", "", 170, 480, 735, 413, 1) WinMove("Session D - [24 x 80]", "", 915, 480, 735, 413, 1) If $a <> 0 Then WinMove("Session D - [24 x 80]", "", 915, 480, 735, 413, 1) then everything seems to work, but it seems a rather uneligant solution. Any thoughts? (Using AutoIt 3.3.12.0 on a Win7-64bit machine) My UDFs: Barcode Libraries, Automate creation of any type of project folder, File Locking with Cooperative Semaphores, Inline binary files, Continue script after reboot, WinWaitMulti, Name Aggregator, Enigma, CornedBeef Hash Link to comment Share on other sites More sharing options...
JohnOne Posted September 10, 2014 Share Posted September 10, 2014 Next I'd try activating the window first. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
willichan Posted September 10, 2014 Author Share Posted September 10, 2014 That worked. I am still puzzled as to why it would move the window without activating it first, but not resize it. My UDFs: Barcode Libraries, Automate creation of any type of project folder, File Locking with Cooperative Semaphores, Inline binary files, Continue script after reboot, WinWaitMulti, Name Aggregator, Enigma, CornedBeef Hash Link to comment Share on other sites More sharing options...
JohnOne Posted September 10, 2014 Share Posted September 10, 2014 Does seen a little odd like. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
willichan Posted September 10, 2014 Author Share Posted September 10, 2014 Actually, I just found that activating first still intermittantly does not resize. Global $a $a = WinActivate("Session A - [24 x 80]", "") If $a <> 0 Then WinMove("Session A - [24 x 80]", "", 170, 80, 735, 413, 1) $a = WinActivate("Session B - [24 x 80]", "") If $a <> 0 Then WinMove("Session B - [24 x 80]", "", 915, 80, 735, 413, 1) $a = WinActivate("Session C - [24 x 80]", "") If $a <> 0 Then WinMove("Session C - [24 x 80]", "", 170, 480, 735, 413, 1) $a = WinActivate("Session D - [24 x 80]", "") If $a <> 0 Then WinMove("Session D - [24 x 80]", "", 915, 480, 735, 413, 1) This code works half the time, but only resized the first window the other half. So far the only solution that has not failed is to WinMove() twice for each window. My UDFs: Barcode Libraries, Automate creation of any type of project folder, File Locking with Cooperative Semaphores, Inline binary files, Continue script after reboot, WinWaitMulti, Name Aggregator, Enigma, CornedBeef Hash 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