Jump to content

MsgBox Return Values


Recommended Posts

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

#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

Wend

For possible return values: http://www.autoitscript.com/autoit3/docs/ :D

Edited by marfdaman

Don't take my pic to serious...~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~You Looked, but you did not see!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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...