Jump to content

Recommended Posts

Posted (edited)

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=
Posted (edited)

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

Posted

#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

  • Moderators
Posted

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.

  • Moderators
Posted

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.

Posted

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

i don't think could could have spelled "gulable" at 12 yrs.

( is that right?? )

( is "spelled" right??? )

8)

NEWHeader1.png

Posted (edited)

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=

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
×
×
  • Create New...