darkshadow791 Posted May 2, 2007 Share Posted May 2, 2007 I played around with these functions for a while but I can't get what their real purpose is... Could someone explain + expand on what these func's do? The helpfile doesn't really explain it very well... Note Taker Lite - a note taking / converting tool. Link to comment Share on other sites More sharing options...
Generator Posted May 2, 2007 Share Posted May 2, 2007 I played around with these functions for a while but I can't get what their real purpose is... Could someone explain + expand on what these func's do? The helpfile doesn't really explain it very well...It prevents your script from running twice(usually being used in), also a replacement of _Singleton in Misc.au3 Example: Opt("WinTitleMatchMode",3) Global $Title="Title" If WinExists($Title)=1 Then Exit EndIf AutoItWinSetTitle($Title) ;Rest your script goes here. Link to comment Share on other sites More sharing options...
MHz Posted May 2, 2007 Share Posted May 2, 2007 AutoItWinGetTitle:Retrieves the title name of the AutoIt window.AutoItWinSetTitle:Sets the title name of the AutoIt window.Ok, keeping up so far?Don't worry, as I will explain a little more. AutoIt is a Gui application. Gui applications have a hidden window of some sort which is hidden. This is quite different to the Gui that you can create using Gui functions within an AutoIt script. Every script that is run by AutoIt has a AutoIt hidden window. This window can be used to advantage as such as Generator has mentioned. Another method is for one AutoIt script to politely close another AutoIt script without using the deadly blow of ProcessClose. The example below is not 2 separate scripts, but does demonstrate the idea of politely closing a script, whether the same or another.$title = AutoitWinGetTitle() MsgBox(0x40000, 'AutoitWinGetTitle()', '$title = ' & $title) WinWait($title) WinSetState($title, '', @SW_MAXIMIZE) WinSetState($title, '', @SW_SHOW) Sleep(2000) WinClose($title) MsgBox(0x40000, 'Notice', 'End of script') Exit Func OnAutoItExit() MsgBox(0x40000, 'Notice', 'Script is politely closing the AutoIt hidden window...to close the script') EndFunc Func OnAutoItStart() If WinExists('AutoIt hidden window') Then Exit AutoItWinSetTitle('AutoIt hidden window') EndFunc Link to comment Share on other sites More sharing options...
therks Posted May 2, 2007 Share Posted May 2, 2007 Gui applications have a hidden window of some sort which is hidden.As opposed to having a hidden window of some sort that's... visible? Sorry just couldn't help myself, it made me chuckle. My AutoIt Stuff | My Github Link to comment Share on other sites More sharing options...
darkshadow791 Posted May 2, 2007 Author Share Posted May 2, 2007 AutoItWinGetTitle: Retrieves the title name of the AutoIt window. AutoItWinSetTitle: Sets the title name of the AutoIt window. Ok, keeping up so far? Don't worry, as I will explain a little more. AutoIt is a Gui application. Gui applications have a hidden window of some sort which is hidden. This is quite different to the Gui that you can create using Gui functions within an AutoIt script. Every script that is run by AutoIt has a AutoIt hidden window. This window can be used to advantage as such as Generator has mentioned. Another method is for one AutoIt script to politely close another AutoIt script without using the deadly blow of ProcessClose. The example below is not 2 separate scripts, but does demonstrate the idea of politely closing a script, whether the same or another. $title = AutoitWinGetTitle() MsgBox(0x40000, 'AutoitWinGetTitle()', '$title = ' & $title) WinWait($title) WinSetState($title, '', @SW_MAXIMIZE) WinSetState($title, '', @SW_SHOW) Sleep(2000) WinClose($title) MsgBox(0x40000, 'Notice', 'End of script') Exit Func OnAutoItExit() MsgBox(0x40000, 'Notice', 'Script is politely closing the AutoIt hidden window...to close the script') EndFunc Func OnAutoItStart() If WinExists('AutoIt hidden window') Then Exit AutoItWinSetTitle('AutoIt hidden window') EndFunc Thank you! This definitely clears this up, I never quite understood what the purpose of this was, and now I do Note Taker Lite - a note taking / converting tool. 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