dietpepsi Posted July 18, 2010 Share Posted July 18, 2010 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. Link to comment Share on other sites More sharing options...
Yoriz Posted July 18, 2010 Share Posted July 18, 2010 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. Link to comment Share on other sites More sharing options...
sleepydvdr Posted July 18, 2010 Share Posted July 18, 2010 Windows' calculator isn't actually a window, is it? It's an executable. How about using ProcessClose? #include <ByteMe.au3> Link to comment Share on other sites More sharing options...
Info Posted July 18, 2010 Share Posted July 18, 2010 Windows' calculator isn't actually a window, is it? It's an executable. How about using ProcessClose?wat Link to comment Share on other sites More sharing options...
Theri Posted July 18, 2010 Share Posted July 18, 2010 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. Link to comment Share on other sites More sharing options...
Info Posted July 18, 2010 Share Posted July 18, 2010 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 Link to comment Share on other sites More sharing options...
dietpepsi Posted July 18, 2010 Author Share Posted July 18, 2010 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 I should have known that. Thank you guys for the help. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now