Jump to content

Simple MsgBox question


Recommended Posts

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

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