Sign in to follow this  
Followers 0
Assault

Start running on button press

3 posts in this topic

I want the script to start after a button on the gui is pressed, I'm using this :

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            exit
        Case $nmsg = $Button1
            call("main")    
        Case $nmsg = $Button2
           Exit

    EndSwitch
WEnd

but it starts the script before the button is pressed.


Share this post


Link to post
Share on other sites



While 1
    $nMsg = GUIGetMsg()
    Select $nMsg
        Case $nMsg = $GUI_EVENT_CLOSE
            exit
        Case $nMsg = $Button1
           main()   
        Case $nMsg = $Button2
          Exit
    EndSelect
WEnd

Func main()
    Msgbox(266288,"No Title","$Button1 pressed")
EndFunc

Eltorro

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