Sign in to follow this  
Followers 0
=sinister=

Exiting a GUI when looping

13 posts in this topic

#1 ·  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=

Share this post


Link to post
Share on other sites



#2 ·  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

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

I have 267 posts,

and I mean exiting when theres a loop inside a loop.

Edited by =sinister=

Share this post


Link to post
Share on other sites

I have 267 posts,

and I mean exiting when theres a loop inside a loop.

ok...

you want to exit the program... or just the loop

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

the program. Actually, anyone would be better, I could edit it later.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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.


[center]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.[/center]

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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!

[center]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.[/center]

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

#11 ·  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=

Share this post


Link to post
Share on other sites

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

( is that right?? )

( is "spelled" right??? )

8)

It's gullible.

Share this post


Link to post
Share on other sites

Ah, what the hell, if you can read it, it's good. :o

Share this post


Link to post
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
Sign in to follow this  
Followers 0