Jump to content

Recommended Posts

Posted

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)

 

Posted

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. :ermm:

So far the only solution that has not failed is to WinMove() twice for each window. :huh2:  :think:

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...