Oniris Posted July 7, 2006 Share Posted July 7, 2006 Hi, I know how to get the return value of a button in a gui : #include <GUIConstants.au3> GUICreate("OK", 110, 60) ; will create a dialog box that when displayed is centered GUISetState () Opt("GUICoordMode",2) $OK = GUICtrlCreateButton ("OK", 5, 5, 100,50) While 1 $msg = GUIGetMsg() If $msg = $OK THEN MsgBox(0, "OK pressed","You pressed ok") ENDIF If $msg = $GUI_EVENT_CLOSE Then ExitLoop Wend But how do I detect the "OK" in the message box that follows? Sorry for the newb question, but I didn't find it in the message box function reference Link to comment Share on other sites More sharing options...
marfdaman Posted July 7, 2006 Share Posted July 7, 2006 (edited) #include <GUIConstants.au3> GUICreate("OK", 110, 60) ; will create a dialog box that when displayed is centered GUISetState () Opt("GUICoordMode",2) $OK = GUICtrlCreateButton ("OK", 5, 5, 100,50) While 1 $msg = GUIGetMsg() If $msg = $OK THEN $result = MsgBox(0, "OK pressed","You pressed ok") MsgBox(0, $result, $result) ENDIF If $msg = $GUI_EVENT_CLOSE Then ExitLoop WendFor possible return values: http://www.autoitscript.com/autoit3/docs/ Edited July 7, 2006 by marfdaman Don't take my pic to serious...~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~You Looked, but you did not see!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Link to comment Share on other sites More sharing options...
Oniris Posted July 7, 2006 Author Share Posted July 7, 2006 Perfect marfdaman, Thank you Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now