#include <GUIConstantsEx.au3>
#Include <WindowsConstants.au3>
HotKeySet( '{F6}', '_Exit' )
Global $_iHour = 18, $_iMin = 0
Global $_iSleep = _CalcSleep( $_iHour, $_iMin, @HOUR, @MIN )
; ---
_Sleep( $_iSleep )
_OnEvent()
Func _OnEvent()
Local $_iWidth = @DesktopWidth - 100, $_iHeight = @DesktopHeight - 100
; ---
Local $_hGui = GUICreate('', $_iWidth, $_iHeight, 50, 50, $WS_POPUP, $WS_EX_TOOLWINDOW )
GUICtrlCreateLabel( 'Выключите компьютер!', ($_iWidth / 2)-50, ($_iWidth / 2)-10, 100, 20 )
GUICtrlSetColor( -1, 0xff0000 )
; ---
GUISetState()
While 1
Sleep( 10 )
WEnd
EndFunc
; ===
Func _Sleep( $_iSleep )
While $_iSleep
$_iSleep -= 0.001
Sleep( 60 )
WEnd
EndFunc
Func _CalcSleep( $_iHour, $_iMin, $_iCurHour, $_iCurMin )
Local $_iMins = ( 60 * $_iHour ) + $_iMin
Local $_iCurMins = ( 60 * $_iCurHour ) + $_iCurMin
If $_iMins <= $_iCurMins Then
Return $_iCurMins - $_iMins
Else
Return ( ( 24 * 60 ) - $_iCurMins ) + $_iMins
EndIf
EndFunc
Func _Exit()
Exit 0
EndFunc