Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/29/2018 in File Reviews

  1. careca

    Time4Shutdown

    #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=Resources\Clock.ico #AutoIt3Wrapper_UseX64=n #AutoIt3Wrapper_Res_Icon_Add=Resources\Clock.ico #AutoIt3Wrapper_Run_Tidy=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <WinAPI.au3> Opt("TrayAutoPause", 0) Opt("GUIOnEventMode", 1) #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Time4Shutdown", 395, 32, 250, 475, -1, $WS_EX_DLGMODALFRAME) GUISetOnEvent($GUI_EVENT_CLOSE, "Close") $settime = GUICtrlCreateInput("", 168, 5, 49, 21) $Label1 = GUICtrlCreateLabel("Set time for shutdown in minutes", 8, 8, 156, 17) $Button1 = GUICtrlCreateButton("Start", 234, 3, 75, 25) GUICtrlSetOnEvent($Button1, "Start") $Button2 = GUICtrlCreateButton("Reboot", 314, 3, 75, 25) GUICtrlSetOnEvent($Button2, "Reboot") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### Func Start() GUISetState(@SW_HIDE) $time = GUICtrlRead($settime, 1) $timetosleep = $time * 60 Do ToolTip($timetosleep & ' Seconds Remanining', 300, 0) Sleep(995) $timetosleep -= 1 Until $timetosleep <= 0 ToolTip("") Shutdown(13) Exit EndFunc ;==>Start Func Reboot() Local $iMsgBoxAnswer $iMsgBoxAnswer = MsgBox(4164, "Notice", "Do you really want to reboot?") Select Case $iMsgBoxAnswer = 6 ;Yes Case $iMsgBoxAnswer = 7 ;No EndSelect If $iMsgBoxAnswer = 6 Then MsgBox(4096, "Notice", "Clicked Yes! Going to reboot") Shutdown(6) ElseIf $iMsgBoxAnswer = 7 Then MsgBox(4096, "Notice", "Clicked No! Aborting reboot") EndIf EndFunc ;==>Reboot Func Close() Exit EndFunc ;==>Close Do Sleep(100) Until $Form1 = $GUI_EVENT_CLOSE
    1 point
×
×
  • Create New...