#include <GUIConstantsEx.au3>
$hGui = GUICreate('My Program', 250, 260)
$nButton = GUICtrlCreateButton('Click', 60, 50, 110, 30)
GUISetState()
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
If MsgBox(32 + 4, 'Question', 'Выходим', Default, $hGui) = 6 Then Exit
Case $nButton
If MsgBox(32 + 4, 'Question', 'Да или нет?', Default, $hGui) = 6 Then
MsgBox(64, 'Info', 'Да')
Else
MsgBox(64, 'Info', 'Нет')
EndIf
EndSwitch
WEnd