Sign in to follow this  
Followers 0
dietpepsi

WinCose

7 posts in this topic

I'm trying to close a calculator window and I've tried a half a dozen different ways using class and various title/text combinations, nothing seems to work.

Here are a few of the things I've tried *with and without #requireadmin*

Run("Calc")

WinClose("Calculator")

Run("Calc")

WinClose("Calculator", "0")

Run("Calc")

WinClose("Calculator", "")

Run("Calc")

WinClose("[class:CalcFrame]")

Run("Calc")

WinClose("[CLASS:#32770; INSTANCE:1]")

I suppose I could try other methods like PID and other things that I've seen in the help file but I want to find out what I'm doing wrong here. Any suggestions ?

Any help would be much appreciated. I'm running windows 7.

Share this post


Link to post
Share on other sites



Use WinWait to give it a chance to open before the close command.

Run("calc")
WinWait("Calculator")
WinClose("Calculator")

GDIPlusDispose - A modified version of GDIPlus that auto disposes of its own objects before shutdown of the Dll using the same function Syntax as the original.EzMySql UDF - Use MySql Databases with autoit with syntax similar to SQLite UDF.

Share this post


Link to post
Share on other sites

Windows' calculator isn't actually a window, is it? It's an executable. How about using ProcessClose?


#include <ByteMe.au3>

Share this post


Link to post
Share on other sites

Windows' calculator isn't actually a window, is it? It's an executable. How about using ProcessClose?

wat

Share this post


Link to post
Share on other sites

I ran:

$wTitle = "Calculator"
WinClose($wTitle)

And the calculator closed just fine for me. Windows Vista, administrator account and UAC is off. For what that's worth to you.

Share this post


Link to post
Share on other sites

The mistake in dierpepsi's script was that it tried to close the calculator window before it was opened.

Yoriz's solution works just fine

Share this post


Link to post
Share on other sites

The mistake in dierpepsi's script was that it tried to close the calculator window before it was opened.

Yoriz's solution works just fine

:blink: I should have known that. Thank you guys for the help.

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