Sign in to follow this  
Followers 0
Zest

Activate sub-window with identical name

11 posts in this topic

Hello,

I'm trying to writ a script for a 3D CAD program that searches an 'output list' for specific text strings.

This output list is a subwindow in the program, called 'List Window'. In this windows, all informational text on commands etc. is displayed.

Now I have no problem activating this subwindow by name, BUT since we use 2 versions of this program at work, it is possible to have 2 of these subwindows on screen at the same time. One in the 1st version of the program and one in the second.

Is there a way to uniquely identify each of these windows so that it's not possible to activate the 'List Window' in the wrong program version when 2 instances of the program are open?

I tried getting the class name with the spy tool, but this name always changes :-(

Now I don't know what to look for anymore.

Just to be a bit more clear, the setup is this:

1) Main Program Window Title: 'Program version 1'

Subwindow: 'List window'

2) Main Program Window Title: 'Program version 2'

Subwindow: 'List window'

Any help is greatly appreciated!

Share this post


Link to post
Share on other sites



Use the AU3_SPY included to get the classname of the child window. You can also specify the text parameter of most things that have to do with a window.


Who else would I be?

Share this post


Link to post
Share on other sites

The problems are:

1) the class child name is 'Edit1' to 'Edit5', and this always changes,

2) the text is also always different....

So I guess this really is hard to do :-(

Share this post


Link to post
Share on other sites

The problems are:

1) the class child name is 'Edit1' to 'Edit5', and this always changes,

2) the text is also always different....

So I guess this really is hard to do :-(

<{POST_SNAPBACK}>

If it is only Edit1 - Edit5 that changes then you should be fine. (Do each one of them change from Edit1 - Edit5 or just the one you are wanting to get ahold of?) I am trying to think if you could write an IF statement checking to see if it is anyone of those.

I am also sure you could use AutoIt to run the spy program and figure out the name that way and then just use a variable to put it in. (I dont know how this would be done, but I am trying to give you ideas so someone more advanced can help).

JS


AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

If it is only Edit1 - Edit5 that changes then you should be fine. (Do each one of them change from Edit1 - Edit5 or just the one you are wanting to get ahold of?) I am trying to think if you could write an IF statement checking to see if it is anyone of those.

I am also sure you could use AutoIt to run the spy program and figure out the name that way and then just use a variable to put it in. (I dont know how this would be done, but I am trying to give you ideas so someone more advanced can help).

JS

<{POST_SNAPBACK}>

This also won't work, becasue I can't determine if e.g. 'Edit3' is in program instance one or 2. I also noticed that the spy doesn't get the position of the list window correctly when it's docked in a program toolbar :-(.

This is more complicated than I thought, mainly because of some script commands not working correctly on this CAD program, like WinGetPos, WinGetState (both I tested and worked on normal programs). Then this uniquely identifying a window issue adds to the complexity. But I'm not giving up!

Edited by Zest

Share this post


Link to post
Share on other sites

Hi,

Perhaps this makes it easier ?

Run("Cad Program Version 1.exe")
WinWaitActive("Cad Program")
WinSetTitle("Cad Progra","","New Cad")
Run("Cad Program Version 2.exe")
WinWaitActive("Cad Program")
WinSetTitle("Cad Progra","","Newer Cad")

Regards,

Andre


What about Windows without using AutoIt ?It would be the same as driving a car without an steering Wheel!

Share this post


Link to post
Share on other sites

Hi,

Perhaps this makes it easier ?

Run("Cad Program Version 1.exe")
WinWaitActive("Cad Program")
WinSetTitle("Cad Progra","","New Cad")
Run("Cad Program Version 2.exe")
WinWaitActive("Cad Program")
WinSetTitle("Cad Progra","","Newer Cad")

Regards,

Andre

<{POST_SNAPBACK}>

This would work for the main program windows, but not for the list windows, since I have not yet found a way to uniquely identify these. So when I use WinSetTitle it will always take the last active list window, which is not automatically the one in the program version that is currently active.

I hope this is clear ....

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

What is this called? I forget. Midi-child window or something like that. They have always been a problem. Like the windows in a PaintShopPro app and such.

Lar.

<{POST_SNAPBACK}>

It's indeed some kind of subwindow. The picture here:

http://www.cadalyst.com/cadalyst/data/arti.../79134/fig4.jpg

shows a screenshot of the program. The leftmost window near the bottom is the list window. Here it displays "selected 6 entities" and so on...

Underneath the two bottom windows is a gray "container window" (not visible here) where you can arrange the list window and toolbars e.g.

See how it's complicated :-) / :-(

Does anyone have a solution or another idea?

Edited by Zest

Share this post


Link to post
Share on other sites

It's indeed some kind of subwindow. The picture here:

http://www.cadalyst.com/cadalyst/data/arti.../79134/fig4.jpg

shows a screenshot of the program. The leftmost window near the bottom is the list window. Here it displays "selected 6 entities" and so on...

Underneath the two bottom windows is a gray "container window" (not visible here) where you can arrange the list window and toolbars e.g.

See how it's complicated :-) / :-(

Does anyone have a solution or another idea?

<{POST_SNAPBACK}>

Share this post


Link to post
Share on other sites

<{POST_SNAPBACK}>

Can't you do something that always forces text into the list window? Then you could check that text to make sure you have the correct window. Something like go to print, then search for that text in the window, etc...

just a thought, get something to log into each window first, perhaps based on the startup order, etc...

Share this post


Link to post
Share on other sites

Can't you do something that always forces text into the list window?  Then you could check that text to make sure you have the correct window.  Something like go to print, then search for that text in the window, etc...

just a thought, get something to log into each window first, perhaps based on the startup order, etc...

<{POST_SNAPBACK}>

That's a good idea itn itself, but unfortunately this also won't work:

The list window shows a maximum of 1000 lines of text. After that the first lines are shifted off the list, so there is no way to define the first line in the list window. And to get a specific text into the window with a script, I'd have to uniquely identify the window first, so that means I#d be ggoing in circled to solve this problem ....

Nevertheless I want to thank you all for the answers so far and I still hope to get a solution! I guess it's the program that's non-standard Windows that's causing my problems.

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