Jump to content

Exiting a GUI when looping


Recommended Posts

Okay, been trying to figure out a way to exit a GUI when a loop is running after you've clicked a button. Heres my failing attempt -

#include <GUIConstants.au3>

GUICreate("GUI") 
$button = GUICtrlCreateButton ("OK",  10, 30, 50)
GUISetState (@SW_SHOW)


While 1
    $msg = GUIGetMsg()
    Select
    Case $msg = $button
    While 1
    Select
    Case $msg = $GUI_EVENT_CLOSE
        Exit
    EndSelect
    Wend
endselect
Wend

Sure could use some help :o

Edited by =sinister=
Link to comment
Share on other sites

maybe

#include <GUIConstants.au3>

GUICreate("GUI")
$button = GUICtrlCreateButton ("OK",  10, 30, 50)
GUISetState (@SW_SHOW)


While 1
    $msg = GUIGetMsg()
    Select
   
   Case $msg = $button
      Exit  
    
    Case $msg = $GUI_EVENT_CLOSE
        Exit
    
    
endselect
Wend

8)

BTW how many post do you have????

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

#include <GUIConstants.au3>

GUICreate("GUI")
$button = GUICtrlCreateButton("OK", 10, 30, 50)
GUISetState(@SW_SHOW)


While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $button
            While 1
                $msg = GUIGetMsg()
                Select
                    Case $msg = $GUI_EVENT_CLOSE
                        Exit
                EndSelect
            WEnd
    EndSelect
WEnd

need to "listen" for a message in the second loop

8)

NEWHeader1.png

Link to comment
Share on other sites

  • Moderators

While 1
    If Condition = True Then
        While 1
            If Condition = False Then Exit
        Wend
    EndIf
Wend
I showed True / False because you could make it either or for the condition statement based on your needs.

@Valuator - People post just to post.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Moderators

nvm, I got it. You guys kid to much. Im 12 years old and very gulable.

Geeze... I was trying to figure out the facts of life at 12... boy how times have changed!

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Yes things have changed, my mom thinks im too dramatic, and all my friends are retarted and fail math 6. :o

And your right, people do post just to post, but hey, it's not like you get an award for having alot of posts.

Edited by =sinister=
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...