Sign in to follow this  
Followers 0
monochrome90

variable title

7 posts in this topic

#1 ·  Posted (edited)

My current script is

Run("Setup.exe")
If WinWaitActive ("title") Then Send ("{DOWN}")

But what should i do if title is variable (depending on regional language)? there could be title1 and title 2 (for example)....

Edited by monochrome90

Share this post


Link to post
Share on other sites



Can you use the the internal window classname in your situation? Like this.

WinWaitActive("[CLASS:Notepad]", "")

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

yes! <_<

in that case my script would be

Run("Setup.exe")
WinWaitActive ("title", "")
Send ("{DOWN}")

but title still is wariable...

Edited by monochrome90

Share this post


Link to post
Share on other sites

ProcessGetHWnd is a UDF I made once for issues like this. It can return HWnds for

all of the process' windows or it can return a single one. You can also specify a title

to match.

http://www.autoitscript.com/forum/index.ph...handle++process

The UDF:

http://www.autoitscript.com/fileman/users/Helge/udfs/_ProcessGetHWnd.au3

Share this post


Link to post
Share on other sites
<_< didn't understand anything of that UDF...

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Easy stuff:

#include "_ProcessGetHWnd.au3"
$Pid = Run("notepad.exe")
$hwndArray = _ProcessGetHWnd($Pid, 2)
WinWaitActive($hwndArray[1][1])
WinSetTitle ($hwndArray[1][1], "", "NOTEPAD BEEEEYOTCH!" )

This is good for when you don't know the classname.

Edited by weaponx

Share this post


Link to post
Share on other sites

thanks so much! <_<

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