Window response
Moderators: Dorian (MJT support), JRL
Window response
Hi,
I am looking for information on how to determine when a window has become active after being non responsive.
I have an application that after you open it you can specify some search criteria the application goes off to a database to return the required search results. Whilst this happens the application becomes non responsive unitl either a timeout occurs or the search results are returned.
What i would like to be able to do is monitor the application window and when it becomes responsive again carry out further actions (like download the returned search results).
Regards..
Peter
I am looking for information on how to determine when a window has become active after being non responsive.
I have an application that after you open it you can specify some search criteria the application goes off to a database to return the required search results. Whilst this happens the application becomes non responsive unitl either a timeout occurs or the search results are returned.
What i would like to be able to do is monitor the application window and when it becomes responsive again carry out further actions (like download the returned search results).
Regards..
Peter
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Is there not some kind of status indicator? Does part of the window become disabled, like a button? Use Image Recognition.
Unusual for a window to not change at all and just become unresponsive. But if that is the case I guess you could have the script keep trying to click a button (or try to initiate whatever the next step is) and monitor the outcome, if the button click is successful you know the app is responsive and ready for the next step, if not, loop back and keep trying. Again you could use image recognition for this.
Unusual for a window to not change at all and just become unresponsive. But if that is the case I guess you could have the script keep trying to click a button (or try to initiate whatever the next step is) and monitor the outcome, if the button click is successful you know the app is responsive and ready for the next step, if not, loop back and keep trying. Again you could use image recognition for this.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Window non responsive
Thanks for the response..
The application in question is an old 32 bit application and whilst it is busy waiting for a return from the database or a timeout it becomes unresponsive.
In Vista if you click the application window the title bar display the "no repsonse" message
The query that your waiting for displays in a list box above the selection criteria fields (if that makes sense) when it is returned or a popup box will show if the timeout is exceeded with the message "Search has been cancelled".
I was hoping that there was some sort of "waitforwindow" event that I could monitor.
Regards..
Peter.
The application in question is an old 32 bit application and whilst it is busy waiting for a return from the database or a timeout it becomes unresponsive.
In Vista if you click the application window the title bar display the "no repsonse" message
The query that your waiting for displays in a list box above the selection criteria fields (if that makes sense) when it is returned or a popup box will show if the timeout is exceeded with the message "Search has been cancelled".
I was hoping that there was some sort of "waitforwindow" event that I could monitor.
Regards..
Peter.
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Without seeing the app I can't give the definitive solution - and there are always more than one anyway - but it sounds like WaitScreenImage would do the job. You need to make the script wait until the results have appeared, or something else that occurs to indicate completion. Or wait for the timeout window to popup, or not.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Marcus,
Thanks for the update, I've just had a better look at some of the wait commands and will try to see if I can utilise one of those.
The "WaitWindowChanged" looks promising, as the application title bar text changes once the window becomes responsive i.e. the Title shows the returned number of records within the title text.
I'll let you know what happens..
Regards..
Peter
Thanks for the update, I've just had a better look at some of the wait commands and will try to see if I can utilise one of those.
The "WaitWindowChanged" looks promising, as the application title bar text changes once the window becomes responsive i.e. the Title shows the returned number of records within the title text.
I'll let you know what happens..
Regards..
Peter
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
In that case you could use this code too:buda56 wrote:The "WaitWindowChanged" looks promising, as the application title bar text changes once the window becomes responsive i.e. the Title shows the returned number of records within the title text.
Code: Select all
GetActiveWindow>title,x,y
Label>wait_until_done
Wait>0.5
GetActiveWidow>new_title,x,y
If>title=new_title
Goto>wait_until_done
Endif
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Marcus,
Thanks for the code, I have tried several diffferent ways today to get the macro to respond to the window when it becomes active and nothing seems to work.
Here's a segment of my code..
WaitWindowOpen>Load Query
wait>1
Send Character/Text>Tasks Closed1.vql
Press Enter
wait>5
SetFocus>CAMS - AP*
WaitWindowChanged>
SetFocus>CAMS - AP*
Press ALT
Send Character/Text>P
Release ALT
WaitWindowOpen>Print*
Regards..
Peter
Thanks for the code, I have tried several diffferent ways today to get the macro to respond to the window when it becomes active and nothing seems to work.
Here's a segment of my code..
WaitWindowOpen>Load Query
wait>1
Send Character/Text>Tasks Closed1.vql
Press Enter
wait>5
SetFocus>CAMS - AP*
WaitWindowChanged>
SetFocus>CAMS - AP*
Press ALT
Send Character/Text>P
Release ALT
WaitWindowOpen>Print*
Regards..
Peter
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Can you send some screenshots? Or contact support and we'll hook up and view your screen. Otherwise we're playing a bit of a guessing game and only able to suggest things you might try rather than seeing the windows and being able to provide a precise solution.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Support AT mjtnet.com
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?