Jump to content

How to reconize when a button is pushed


Recommended Posts

Think about this part:

Local $hGUI, $sMsg

And:

Switch $sMsg
    Case $Button_Ok
        Exit
EndSwitch

What is $sMsg? Nothing. Do you really want to Switch nothing? Don't you want it to actually do something?

Either you made a mistake, or you have no idea what you're doing. Read "GUI Reference" in the helpfile if you are unsure.

Link to comment
Share on other sites

zmboni128,

If you change this:

; Loop until user exits
         Do
        Switch $sMsg
            Case $Button_Ok
                Exit
        EndSwitch
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc   ;==>_Main

to this:

; Loop until user exits
While 1
        $sMsg = GUIGetMsg()
        Switch $sMsg
            Case $Button_Ok
                Exit
                
            Case $GUI_EVENT_CLOSE
                Exit
        EndSwitch
WEnd

it'll work.

4Eyes

Edited by 4Eyes
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...