#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate("MessageBox", 347, 263)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
If @WDAY = 7 or @WDAY = 2 Then ;Суббота и понедельник
$YES = MsgBox(4, 'MessageBox', 'Выйти из программы ?')
if $YES = 6 then Exit
Else
Exit
EndIf
EndSwitch
WEnd