Sign in to follow this  
Followers 0
DSIS

WinWaitActive times out

7 posts in this topic

In the attached au3 file at line 118(_WinWaitActive("Question")) the script appears to hang. The script executes the MRP process of our ERP application correctly up to this point. The process halts at this "Question" for some reason. The process prior to line 118 takes between 2 and 3 hours. This script used to work just fine. However since we converted this server to a virtual server the hang problem has occurred. I have tried adding code to activate the "Question" window. Three questions please: 1) Will WinWaitActive time out? 2) The fact we converted the server to a virtual server have any affect? 3) Any idea why this might be occurring? Thanks for your help.VMRPRG2.au3

Share this post


Link to post
Share on other sites



How about this:

Do
If WinExists("Question") Then   
    WinActivate("Question")
EndIf
Until WinExists("Question")
_WinWaitActive("Question")

#include <ByteMe.au3>

Share this post


Link to post
Share on other sites

I will try it and let you know. I can only run this in the evening. Thank you.

Share this post


Link to post
Share on other sites

Tried the suggestion to use Win Exists but it did not work. I had an opportunity to observe the program. When AutoIT starts running the ERP program the AutoIT icon is in the lower right tool bar. At some point this icon disappears. Does that indicate that the entire program died? It appears that is what happens because at the end of the ERP program there is no apparent attempt to perform any other action. No errors. Nothing. Please advise. Thank you.

Share this post


Link to post
Share on other sites

I decided to create another AutoIt program that checks for the existence of the "Question" window. I execute this about the time the ERP program is supposed to finish. I also execute it again an hour or so later to make sure the question is answered and the ERP program is exited gracefully. I restrict the loop to a max number so it doesn't run forever. I don't know if this is the best solution but so far it is working.

Share this post


Link to post
Share on other sites

First of all consider me as a newbie, then...

If I was in you I would add a ConsoleWrite now and then to check the on-going of the script...

And, usually other than if you have hidden it, if there isn't the autoit icon on the lower right corner it means that the program isn't running anymore.

Be sure to have your console open to check if there is any message.

(While having your source code in autoit editor press F8 to show/hide Console)

Share this post


Link to post
Share on other sites

I am not familiar with ConsoleWrite. Help says it writes output to the console. Could you give me an idea of how I might use this by replying with a sample of code? Thanks.

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