Jump to content

How to create a separate GUI window?


qwert
 Share

Recommended Posts

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

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

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

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

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

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 by blademonkey

---"Educate the Mind, Make Savage the Body" -Mao Tse Tung

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...