I'm wanting to close a window once the program has finished and window is displaying the word "Finished". Using View System Window I've identified the handle - class name and object text as follows:
Window Name-263896 - App032 "ProVal Interface"
Area of Window-198376 - Static "Finished"
It can take hours for this to run so I guess I need the script to loop until the window displays finished. I do not know how to proceed from here to bring Finished in to my script in order to close the window. Your help for this beginner would be appreciated.
How to close window using GetWindowText
Moderators: Dorian (MJT support), JRL
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
Check out Help for WaitWindowOpen
RunProgram>Drive\Path\program.exe
WaitWindowOpen>Finished*
Do other stuff or stop as desired.
RunProgram>Drive\Path\program.exe
WaitWindowOpen>Finished*
Do other stuff or stop as desired.
Last edited by Bob Hansen on Mon Jan 23, 2006 8:12 pm, edited 1 time in total.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
Bob, is Finished the name of the window, or the text he's looking for? If it's just the text wwo won't help (although I defer to your greater knowledge...)
Things to think about; is the cursor an hourglass when the app is running? If so, you could use the WaitCursorChanged (wcc) command to test for this.
If the ProVal Interface window is the main window running, and the text appears on it, you can use the GetWindowText command to dump the text into a variable and then use Position to grep for it.
Pseudo code might look like this:
GWT>ProVal Interface,windowtext
pos>Finished,%windowtext%,1,finishedresult
if>%finishedresult%>0
the program has ended
endif
Take care, Ian
Things to think about; is the cursor an hourglass when the app is running? If so, you could use the WaitCursorChanged (wcc) command to test for this.
If the ProVal Interface window is the main window running, and the text appears on it, you can use the GetWindowText command to dump the text into a variable and then use Position to grep for it.
Pseudo code might look like this:
GWT>ProVal Interface,windowtext
pos>Finished,%windowtext%,1,finishedresult
if>%finishedresult%>0
the program has ended
endif
Take care, Ian
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
How to close window with GetWindowText
Thanx Ian. Your suggestion is exactly what I was looking for. The word Finished is not the window name but is text present within the window once the program has completed.
...you might also try using GetControlText.
GCT>WindowName,Static,X,TextFound
where X is the instance of the Static text within the WindowName.
I like using gct in this case...seems more exact....What if Finished appears somewhere else on the screen? Like an error message saying, "Unable to display Finished".....
SkunkWorks
GCT>WindowName,Static,X,TextFound
where X is the instance of the Static text within the WindowName.
I like using gct in this case...seems more exact....What if Finished appears somewhere else on the screen? Like an error message saying, "Unable to display Finished".....
SkunkWorks