extremcs2 Posted July 28, 2010 Report Posted July 28, 2010 (edited) [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 July 28, 2010 by extremcs2 Quote
d33nis Posted October 27, 2010 Report Posted October 27, 2010 baga fratioare un link de download si pentru aia care nu se pricep sa faca programu` Quote
MembruRST Posted October 27, 2010 Report Posted October 27, 2010 Eu daca vreau autoshutdown, scriu in run:shutdown -s -t <secunde>Si am rezolvat shutdown -s -t 10si se inchide peste 10 secunde. Quote
newbie Posted October 27, 2010 Report Posted October 27, 2010 d33nis : nu vreau sa fiu rau ,dar daca nu stii sa compilezi un program cu sursa deja facuta de altu ...nu te vad bine.just my opinion. Quote