Jump to content

Newbie, Appreciated Help To Close 1st Of 2 Windows


Recommended Posts

Below is a small section of the first script I have attempted and I am geeting on fine, but how do I close the first window when the second one pops up? It stays there until the rest of the code completes and exits. Help would be much appreciated. :think:

#include <GUIConstants.au3>

GUICreate("Choice",200,100)

$contextmenu = GUICtrlCreateContextMenu ()

GUICtrlCreateLabel ("Is this a Single or an Album?", 10, 20, 200, 30)

$SingleButton = GUICtrlCreateButton("Single",7,60,100,20)

$AlbumButton2 = GUICtrlCreateButton("Album",110,60,80,20)

GUISetState ()

While 1

$msg = GUIGetMsg()

Select

Case $msg = $SingleButton

$Choice = "Single"

ExitLoop

Case $msg = $AlbumButton2

$Choice = "Album"

ExitLoop

Case $msg = $GUI_EVENT_CLOSE

; MsgBox(0, "GUI Event", "You clicked CLOSE! Exiting...")

Exit

EndSelect

Wend

; More Code

MsgBox(0, "AutoIt", "OK. Lets Go!")

; More Code

Exit

Link to comment
Share on other sites

maybe

#include <GUIConstants.au3>

$Choice = GUICreate("Choice", 200, 100)

$contextmenu = GUICtrlCreateContextMenu()
GUICtrlCreateLabel("Is this a Single or an Album?", 10, 20, 200, 30)
$SingleButton = GUICtrlCreateButton("Single", 7, 60, 100, 20)
$AlbumButton2 = GUICtrlCreateButton("Album", 110, 60, 80, 20)

GUISetState()

While 1
    $msg = GUIGetMsg()
    
    Select
        Case $msg = $SingleButton
            $Choice = "Single"
            GUIDelete($Choice)
            ExitLoop
            
        Case $msg = $AlbumButton2
            $Choice = "Album"
            GUIDelete($Choice)
            ExitLoop
            
        Case $msg = $GUI_EVENT_CLOSE
            MsgBox(0, "GUI Event", "You clicked CLOSE! Exiting...", 1)
            Exit
    EndSelect
    
WEnd

; More Code

MsgBox(0, "AutoIt", "OK. Lets Go!", 2)

; More Code

Exit

8)

NEWHeader1.png

Link to comment
Share on other sites

maybe

#include <GUIConstants.au3>

$Choice = GUICreate("Choice", 200, 100)

$contextmenu = GUICtrlCreateContextMenu()
GUICtrlCreateLabel("Is this a Single or an Album?", 10, 20, 200, 30)
$SingleButton = GUICtrlCreateButton("Single", 7, 60, 100, 20)
$AlbumButton2 = GUICtrlCreateButton("Album", 110, 60, 80, 20)

GUISetState()

While 1
    $msg = GUIGetMsg()
    
    Select
        Case $msg = $SingleButton
            $Choice = "Single"
            GUIDelete($Choice)
            ExitLoop
            
        Case $msg = $AlbumButton2
            $Choice = "Album"
            GUIDelete($Choice)
            ExitLoop
            
        Case $msg = $GUI_EVENT_CLOSE
            MsgBox(0, "GUI Event", "You clicked CLOSE! Exiting...", 1)
            Exit
    EndSelect
    
WEnd

; More Code

MsgBox(0, "AutoIt", "OK. Lets Go!", 2)

; More Code

Exit

8)

Thanks a lot Valuater, just what I wanted - really appreciate your quick response. I think this is a great scripting program :think:
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...