Jump to content
extremcs2

Auto Shutdown

Recommended Posts

Posted (edited)

2lvmk5k.png

[COLOR="SandyBrown"]#include <guiconstants.au3>[/COLOR]

[COLOR="Blue"]Global $set, $time

$form = GUICreate("[/COLOR][COLOR="Red"]Auto Shutdown[/COLOR]"[COLOR="Blue"], 200, 100)

$about = GUICtrlCreateLabel("[/COLOR][COLOR="Red"]Acest program ajuta utilizatorul sa isi opreasca PC la o anumita ora aleasa de acesta. [/COLOR]

[COLOR="Blue"]Ora va fi de forma [/COLOR][COLOR="Red"]20:22[/COLOR][COLOR="Blue"] ", 2, 4, 198, 50)

$text = GUICtrlCreateLabel("[/COLOR][COLOR="Red"]Scrie ora la care computerul se va opri[/COLOR]"[COLOR="Blue"], 2, 50, 198, 18)

$ora = GUICtrlCreateInput("20:22", 72, 74, 50, 18)

$save = GUICtrlCreateButton("[/COLOR][COLOR="Red"]Salveaza[/COLOR]"[COLOR="Blue"], 6, 74, 58, 19)

$reset = GUICtrlCreateButton("[/COLOR][COLOR="Red"]Reset[/COLOR][COLOR="Blue"]", 130, 74, 58, 19)

GUISetBkColor(0xbfbfbf)

GUICtrlSetBkColor($text, 0xbfbfbf)

GUICtrlSetBkColor($ora, 0xbfbfbf)

GUICtrlSetColor($text, 0x000000)

GUICtrlSetColor($ora, 0x000000)

GUICtrlSetState($reset, $GUI_DISABLE)

GUISetState()

Func get_time()

$set = GUICtrlRead($ora)

GUICtrlSetState($ora, $GUI_DISABLE)

GUICtrlSetState($save, $GUI_DISABLE)

GUICtrlSetState($reset, $GUI_ENABLE)
EndFunc


func resetIT()

GUICtrlSetState($ora, $GUI_ENABLE)

GUICtrlSetState($save, $GUI_ENABLE)

GUICtrlSetState($reset, $GUI_DISABLE)

$set = ""

EndFunc

func check()

$time = @HOUR & ":" & @MIN

if $time = $set Then

Shutdown(1)

Exit

EndIf

EndFunc

While 1

$msg = GUIGetMsg()

Switch $msg

Case $GUI_EVENT_CLOSE

Exit

Case $save

get_time()

GUISetState(@SW_MINIMIZE, $form)

case $reset

resetIT()

EndSwitch

check() ;verific ora.

WEnd[/COLOR]

Sursa : Auto Shutdown in AutoIT : Programare

Edited by extremcs2

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...