Jump to content

WinWaitClose not working


DickG
 Share

Recommended Posts

I am trying to use WinWaitClose("Windows Internet Explorer") to detect when the user closes IE. But the script just hangs. I have to stop the script manually.

A search here for WinWaitClose didn't turn up anything. I am using AutoIt v3.2.10 on WinXP SP2.

Anyone know if this command has a problem, and any workaround?

Thanks

Dick

Link to comment
Share on other sites

Try adding Opt("WinTitleMatchMode", 2) at the top off your script.


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

Really? I sure have it. See attached screenshot of IE opened to a blank page. It says "Blank Page - Windows Internet Explorer."

So I don't understand your reply.

Maybe because there is no window titled "Windows Internet Explorer", on any computer on earth.

post-27031-1199127353_thumb.png

Link to comment
Share on other sites

Like BigDod showed, you were trying to match "Windows Internet Explorer" to "Blank Page - Windows Internet Explorer" and you needed to set the option for partial match.

Also, the title is typically Microsoft Internet Explorer.

Link to comment
Share on other sites

This worked for me

Opt("WinTitleMatchMode", 2)
WinWaitClose("Windows Internet Explorer")
MsgBox(0,"","IE Closed")

Perhaps you should show us your code.


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

I just noticed that I had already included that directive [Opt("WinTitleMatchMode", 2)], which is why I was just looking for a partial match. But I will change my code to just look for "Internet Explorer".

Howerver, I discovered the real problem: it looks like an instance of IE was still running in the background (nothing visible), even though I had closed IE. After forcing it closed, the command worked. So I will have to find a way to detect if the IE process is still running after the WinWaitClose command and force it closed.

But about this "Microsoft Internet Explorer" vs "Windows Internet Explorer" thing, you can see in the screenshot that it says "Windows Internet Explorer". Using a process explorer shows the Product Name for IE is "Windows Internet Explorer." I am using the latest IE7. So am I missing something? Why do you say that "Microsoft Internet Explorer" is typical?

Like BigDod showed, you were trying to match "Windows Internet Explorer" to "Blank Page - Windows Internet Explorer" and you needed to set the option for partial match.

Also, the title is typically Microsoft Internet Explorer.

Link to comment
Share on other sites

Yeah, good catch. I saw your response after I posted a reply about it.

Thanks for your help. If I had not thought about doing that just before I saw your reply, your suggestion would have certainly helped.

Regards,

Dick

Hmm...did you run the task manager to make sure no other instances of iexplore.exe are running?

Link to comment
Share on other sites

But about this "Microsoft Internet Explorer" vs "Windows Internet Explorer" thing, you can see in the screenshot that it says "Windows Internet Explorer". Using a process explorer shows the Product Name for IE is "Windows Internet Explorer." I am using the latest IE7. So am I missing something? Why do you say that "Microsoft Internet Explorer" is typical?

Ignore my first post. That was the first time I have seen it called Windows Internet Explorer, maybe IE7 only.

Edited by weaponx
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...