qwert Posted January 23, 2008 Share Posted January 23, 2008 I need to have a script create an independent window that stays on the screen after the script ends. So far, either the window is deleted when the script exits -- or I end up with the script still running, which I don't want. Is there a simple way to accomplish this? Thanks in advance for any help. Link to comment Share on other sites More sharing options...
GEOSoft Posted January 23, 2008 Share Posted January 23, 2008 I need to have a script create an independent window that stays on the screen after the script ends. So far, either the window is deleted when the script exits -- or I end up with the script still running, which I don't want. Is there a simple way to accomplish this?Thanks in advance for any help.You will have to use 2 scripts to do it. When you exit a script anything created in that script is gone. You might be able to use GUIDelete() to get rid of one Window but that won't stop the script from running. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
qwert Posted January 23, 2008 Author Share Posted January 23, 2008 You will have to use 2 scripts to do it.I had thought of launching a second script, but didn't want to complicate my set of compiled scripts unnecessarily -- but I guess that's how to inform windows "this is different".Thanks for the response. Link to comment Share on other sites More sharing options...
blademonkey Posted January 23, 2008 Share Posted January 23, 2008 or use one script twice. $sTrigger ="popup" if $cmdline[0] >= 1 Then if $cmdline[1] = $sTrigger Then MsgBox(0,"popup","this is called by the same script") Exit EndIf Elseif $cmdline[0] = 0 then MsgBox(0,"blah","after you click on this it should call itself") runwait(@ScriptName & ' ' & $sTrigger) EndIf ---"Educate the Mind, Make Savage the Body" -Mao Tse Tung Link to comment Share on other sites More sharing options...
qwert Posted January 23, 2008 Author Share Posted January 23, 2008 or use one script twice.I need to make sure I understand this. Are you saying that a script calling itself results in an entirely separate copy of the script running under windows? So you can exit the first copy and leave the second copy running -- accomplishing something different and exiting when it sees fit? Sounds good, if true. Link to comment Share on other sites More sharing options...
blademonkey Posted January 23, 2008 Share Posted January 23, 2008 (edited) yes / no Does the script calls itself: yes. Does the original script exit after calling itself: No this is what happens... $sTrigger ="popup" ; <--- script defines a trigger word to be used on later. if $cmdline[0] >= 1 Then ;<--- the script checks if there's one or more cmdline parameter that was invoked if $cmdline[1] = $sTrigger Then ;<--- the script check if the parameter matches the trigger word ; This is where you run your secondary code Exit EndIf Elseif $cmdline[0] = 0 then <--- the script checks if theres a cmdline parameter that was invoked ; This is where you run your primary code EndIf because you're not specifying a parameter when you first run the script, it skips the first if block and goes to the elseif and runs whatever is in there. Now when the elseif block finishes, it called the script WITH a parameter which will envoke the first if statement block. it's a little backwards, but that's how my brain works. Edited January 23, 2008 by blademonkey ---"Educate the Mind, Make Savage the Body" -Mao Tse Tung Link to comment Share on other sites More sharing options...
qwert Posted January 23, 2008 Author Share Posted January 23, 2008 OK, I think I follow that. I'll implement accordingly and confirm when I get results. Thanks very much for the explanation. Link to comment Share on other sites More sharing options...
blademonkey Posted January 23, 2008 Share Posted January 23, 2008 np, hope it works for you. ---"Educate the Mind, Make Savage the Body" -Mao Tse Tung 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