Sign in to follow this  
Followers 0
stever3901

Retrieve window names as they become active

6 posts in this topic

I am trying to write an install script. I have had great success so far using the WinWaitActive function with other programs. However, one program I am trying to script does not seem to name the windows with what is visible. All the windows show Ram Connection 3.0 as their label. Is there a way to write a script that will report back the current open window to the debugger so I can get the list of actual window names for my script?

This is what I am trying to do.

Run("I:\\ENGIN\\Ram Connection 3.0\\RAMConnection\\SetupRC30eng.exe" )

WinWaitActive("Ram Connection 3.0")

Send("{ENTER}")

Thanks

Steve

Share this post


Link to post
Share on other sites



Look at the command winlist() anything active it will report back.

e.g:

for $i = 1 to winlist[0][0]

msgbox(0,"",winlist[1][0])

next

I think thats it. Something to that effect.


F@m!ly Guy Fr33k! - Avatar speaks for itself__________________________________________________________________________________________ite quotes... - Is your refrigerator running? If it is, It probably runs like you...very homosexually - Christians don't believe in gravity - Geeze Brian where do you think you are, Payless?- Show me potato Salad!__________________________________________________________________________________________Programs available - Shutdown timer[indent][/indent]

Share this post


Link to post
Share on other sites

I feel like the newbie I am! I didn't know what the AutoIT Window Info was for... Here is what it says. I have tried to refer to the RAM Connection 3.0 window but it doesn't seem to trigger.

Thoughts?

>>>>>>>>>>>> Window Details <<<<<<<<<<<<<

Title: RAM Connection 3.0

Class: GLBSWizard

Size: X: 262 Y: 190 W: 500 H: 387

>>>>>>>>>>> Mouse Details <<<<<<<<<<<

Screen: X: 392 Y: 545

Cursor ID: 12

>>>>>>>>>>> Pixel Color Under Mouse <<<<<<<<<<<

RGB: Hex: 0xE0DFE3 Dec: 14737379

>>>>>>>>>>> Control Under Mouse <<<<<<<<<<<

Size: X: 0 Y: 0 W: 497 H: 358

Control ID:

ClassNameNN: #327701

Text:

Style: 0x50000044

ExStyle: 0x00000000

>>>>>>>>>>> Status Bar Text <<<<<<<<<<<

>>>>>>>>>>> Visible Window Text <<<<<<<<<<<

&Next >

Cancel

Welcome to RAM Connection 3.0 Setup program. This program will install RAM Connection 3.0 on your computer.

It is strongly recommended that you exit all Windows programs before running this Setup Program.

Click Cancel to quit Setup and close any programs you have running. Click Next to continue with the Setup program.

WARNING: This program is protected by copyright law and international treaties.

Unauthorized reproduction or distribution of this program, or any portion of it, may result in severe civil and criminal penalties, and will be prosecuted to the maximum extent possible under law.

>>>>>>>>>>> Hidden Window Text <<<<<<<<<<<

Share this post


Link to post
Share on other sites

Use the CLASSNAME of the window. It must be different each time.

Use the Opt("WinTitleMatchmode",4) - for exact window classes

Then type WinWaitActive("classname=<Whatever your CLASSNAME is called>","")


F@m!ly Guy Fr33k! - Avatar speaks for itself__________________________________________________________________________________________ite quotes... - Is your refrigerator running? If it is, It probably runs like you...very homosexually - Christians don't believe in gravity - Geeze Brian where do you think you are, Payless?- Show me potato Salad!__________________________________________________________________________________________Programs available - Shutdown timer[indent][/indent]

Share this post


Link to post
Share on other sites

So based on my previous Window info listing I tried this:

Run("I:\\ENGIN\\Ram Connection 3.0\\RAMConnection\\SetupRC30eng.exe" )

Opt("WinTitleMatchmode",4)

WinWaitActive("327701","")

Send("{ENTER}")

Which does not seem to work. I notice that when I highlight different areas of the window, I get different classes. Which part of the window do I need the class from? When I highlight the title bar of the first 3 windows of the installation I get the same thing

>>>>>>>>>>>> Window Details <<<<<<<<<<<<<

Title: RAM Connection 3.0

Class: GLBSWizard

Size: X: 15 Y: 112 W: 500 H: 387

Share this post


Link to post
Share on other sites

It worked!

So let me try to understand what this did.

Adding the text on the window compensated for the fact that all of the window titles were the same.

So Window Title + Window Text = unique window to reference

Is that correct?

WinWait("RAM Connection 3.0","Welcome to RAM Connection")

If Not WinActive("RAM Connection 3.0","Welcome to RAM Connection") Then

WinActivate("RAM Connection 3.0","Welcome to RAM Connection")

EndIf

WinWaitActive("RAM Connection 3.0","Welcome to RAM Connection")

ControlClick("RAM Connection 3.0","Welcome to RAM Connection","&Next >")

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