Sign in to follow this  
Followers 0
nvadekar

using winactivate, how to cycle through multiple windows with same title?

2 posts in this topic

i have a simple test script as follows: (where two teraterm pro windows are open with the same title (connected to two different tcp ports))

$r1 = WinList("192")

if $r1[0][0] == 0 Then

MsgBox(64,"test", "teraterm pro is not open")

Else

MsgBox(0,"test", "number of ttpro windows open: " & $r1[0][0] & " 1: " & $r1[1][0] & " 2: " & $r1[2][0])

$time=0

while 1

For $i = 1 to $r1[0][0]

WinActivate($r1[$i][0])

Send("#keepalive: " & $time & "{enter}")

Next

sleep(60000)

$time=$time+60000

WEnd

EndIf

This simple test is just to demonstrate that if there are two distinct copies of teraterm pro active, using this method of sending data to the who distinct consoles does not work since the titles of the two diff ttpro windows are the same. The keepalive message goes twice to the last active ttermpro window instead of one message to each running window. If the titles of the window were different this does in fact work and each window gets a keepalive message.

I have a situation where I must deal with a dozen ttermpro windows where most of the will have the same title, it would be inappropriate for me to be trying to change the window title. Does anyone have a solution where I can uniquely cycle through all the active windows?

Thanks in advance for any advise.

N

Share this post


Link to post
Share on other sites



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
Sign in to follow this  
Followers 0