Sign in to follow this  
Followers 0
quinner

Simple MsgBox question

3 posts in this topic

Hi guys

Noob question here.....

How do I use the buttons on a message box to do different things?

I dont know what to write so that the cancel button just cancels..... Any help?

CODE
#include <GUIConstants.au3>

GUICreate("Test", 614, 370)

$Button1 = GUICtrlCreateButton("Exit", 96, 104, 75, 25, 0)

GUISetState(@SW_SHOW)

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI_EVENT_CLOSE

ExitFunc()

Case $Button1

ExitFunc()

EndSwitch

WEnd

Func ExitFunc()

$msg = GUIGetMsg()

MsgBox( 1, "Confirmation", "Really Quit?" )

Exit

EndFunc

Share this post


Link to post
Share on other sites



$RESULT = MsgBox ( 1, "User intervention required", "Allow program: Spybot S&D to run?")
;MsgBox(0,"",$RESULT)

Switch $RESULT
    Case 1
        MsgBox(0,"","You clicked OK")
    Case 2
        MsgBox(0,"","You clicked Cancel")
EndSwitch

Share this post


Link to post
Share on other sites

$RESULT = MsgBox ( 1, "User intervention required", "Allow program: Spybot S&D to run?")
;MsgBox(0,"",$RESULT)

Switch $RESULT
    Case 1
        MsgBox(0,"","You clicked OK")
    Case 2
        MsgBox(0,"","You clicked Cancel")
EndSwitch

Thanks a lot :whistle:

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