Я бы сделал так:
Код:

#include <WindowsConstants.au3>
#include <GUIConstants.au3>
$GUI1 = GUICreate("Bot-Info", 150, 200, -1, -1, BitOR($WS_CAPTION, $WS_SYSMENU))
$Buttonexit = GUICtrlCreateButton("Выход", 2, 150, 131, 30)
GUISetState(@SW_SHOW, $GUI1)
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
WinSetState("Bot-Info", "", @SW_MINIMIZE)
Case $Buttonexit
GUISetState(@SW_DISABLE, $GUI1)
$GUI_EXIT = GUICreate("CloseBot", 150, 100, 50, 50, BitOR($WS_CAPTION, $WS_SYSMENU), -1, $GUI1)
GUICtrlCreateLabel("точно выйти???", 3, 3, 300, 15)
$Butexit = GUICtrlCreateButton("Да", 2, 50, 50, 15)
$Butexit1 = GUICtrlCreateButton("Нет", 100, 50, 50, 15)
GUISetState(@SW_SHOW, $GUI_EXIT)
While 1
Switch GUIGetMsg()
Case $Butexit
Exit
Case $Butexit1
DllCall('user32.dll', 'hwnd', 'SetActiveWindow', 'hwnd', $GUI1)
GUIDelete($GUI_EXIT)
GUISetState(@SW_ENABLE, $GUI1)
ExitLoop
EndSwitch
WEnd
EndSwitch
WEnd