Sign in to follow this  
Followers 0
MattH

Problems with WinWait and releated code

10 posts in this topic

I've been using autoit for about a month and really like it. Recently, I've started writing scripts that include activating an application's window. When running the beta run in SciTe, I've noticed that eventually, WinWait, WinActive, WinExists, etc. all "think" that the application's window is still there, even though I've closed the application. The result is that even if the applciation window is open, the script doesn't execute against it. Instead, it just runs to completion as if everything is ok. Like it executed in some ghost window.

The only fix that I've found for this is to log off and back on. I can't figure out what's causing it, but it does seem that if I leave SciTe up for a while and do other work or walk away from the computer, that when I get back, this problem occurs. I'm on Vista Enterprise. Has anyone else experienced this?

Share this post


Link to post
Share on other sites



It does it with any window, even notepad. I even try using the recorder, which is what produced the code below.

#region --- ScriptWriter generated code Start ---

Opt("WinWaitDelay",100)

Opt("WinTitleMatchMode",4)

Opt("WinDetectHiddenText",1)

Opt("MouseCoordMode",0)

WinWait("Untitled - Notepad","")

If Not WinActive("Untitled - Notepad","") Then WinActivate("Untitled - Notepad","")

WinWaitActive("Untitled - Notepad","")

Send("hey")

#endregion --- ScriptWriter generated code End ---

Share this post


Link to post
Share on other sites

I can have notepad up, and it won't type hey. Also, I can close notepad, add $chk = winexists("Untitled - Notepad"), msgbox(0,"",$chk) to the script, run it, and I get a 1, meaning it found it. Log off and back on, run the same script and i get 0.

Share this post


Link to post
Share on other sites

If I go to new app, winexists, winactivate, etc. work fine. So, I plug in notepad again and it will fail. The wintitle is being held in memory somewhere.

Share this post


Link to post
Share on other sites

Just trying different things, I just closed Outlook and Yahoo chat, and I'm getting a winexists = 0. I reopened these two apps and still getting the 0. Could be timing, or one of them might be cashing wintitles for fun!

Share this post


Link to post
Share on other sites

do you think this could be your problem?

Opt("WinTitleMatchMode",4)oÝ÷ Ù8b²+8

Share this post


Link to post
Share on other sites

I've tried changing that and I have tried not using it. Neither seem to make any difference.

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