Adding actions to messages boxes
Message Boxes, like most functions, return one of these values and their respective meanings
Button Pressed Return Values:
OK = $IDOK (1)
CANCEL  = $IDCANCEL (2)
ABORT = $IDABORT (3)
RETRY  = $IDRETRY (4)
IGNORE  = $IDIGNORE (5)
YES =  $IDYES (6)
NO =  $IDNO (7)
CONTINUE **  = $IDCONTINUE (11)
TRY AGAIN ** =  $IDTRYAGAIN (10)

Let’s create a message box and catch the return values and do something with it

 

$returnedValue = MsgBox(4,"Catch Return Value","Push a Button")

if $returnedValue = 6 then
MsgBox(0,"You pushed ....","You pushed YES")
EndIf
if $returnedValue = 7 then
MsgBox(0,"You pushed ....","You pushed NO")
EndIf

;the above 2 "if statements" can also be written as

if $returnedValue = 6 then MsgBox(0,"You pushed ....","You pushed YES")
if $returnedValue = 7 then MsgBox(0,,"You pushed ....","You pushed NO")

 

adding-action-to-autoit-msgbox

 

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *