eignxing Posted October 22, 2009 Share Posted October 22, 2009 For some reason I can't get the following line of code to work. I'm using v3.3.1.2 (beta). WinClose("AutoIt") That command seems to work with any other window title name besides AutoIt. Why? Link to comment Share on other sites More sharing options...
FuryCell Posted October 22, 2009 Share Posted October 22, 2009 (edited) Thats really weird. I can confirm your problem. It seems to me like a bug. Maybe you should submit a bug on the issue tracker. Edited October 22, 2009 by P5ych0Gigabyte HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code. Link to comment Share on other sites More sharing options...
herewasplato Posted October 22, 2009 Share Posted October 22, 2009 For some reason I can't get the following line of code to work. I'm using v3.3.1.2 (beta). WinClose("AutoIt") That command seems to work with any other window title name besides AutoIt. Why? Please show the code just before that line - hopefully, it is not something like this:MsgBox(0, 'AutoIt', '') WinClose("AutoIt") [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
FuryCell Posted October 22, 2009 Share Posted October 22, 2009 (edited) It's definitely a bug. Whats even more odd is that it seems to crash the script. If I run the following script the msgbox is never shown. However if the first line is commented out it runs fine. WinClose("AutoIt") MsgBox(0,"hello","testing") WinClose("test") I am really curious to see what could of caused such wackiness. Edited October 22, 2009 by P5ych0Gigabyte HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code. Link to comment Share on other sites More sharing options...
eignxing Posted October 22, 2009 Author Share Posted October 22, 2009 Please show the code just before that line - hopefully, it is not something like this:MsgBox(0, 'AutoIt', '') WinClose("AutoIt") I have a folder named "AutoIt" on the desktop. I open the folder so it's visible. I run the script with the line above and it executes without closing the window or throwing any warnings/errors. Link to comment Share on other sites More sharing options...
FuryCell Posted October 22, 2009 Share Posted October 22, 2009 (edited) OK i figured out what is going on. AutoIt has a hidden window that it creates when it is running. The title is "AutoIt V3". Running WinClose("AutoIt") teminates the window which kills the script. But changing the title of the autoit window first allows it to work. AutoItWinSetTitle("") WinClose("AutoIt") MsgBox(0,"hello","testing") WinClose("test") So its not really a bug. Edited October 22, 2009 by P5ych0Gigabyte HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code. Link to comment Share on other sites More sharing options...
herewasplato Posted October 22, 2009 Share Posted October 22, 2009 ... AutoIt has a hidden window that it creates when it is running. The title is "AutoIt V3". ...Yep - I was going to lead the OP to that possibility.I use the code that used to be the answer to this FAQhttp://www.autoitscript.com/autoit3/docs/faq.htm#14It renames that hidden window - so I'm used to thinking about that hidden window.@OP,Get the handle of the window after you open it and use that to close the window of interest. [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
eignxing Posted October 22, 2009 Author Share Posted October 22, 2009 Thanks all for the input, it's working perfectly now. 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