Kyme Posted August 2, 2008 Share Posted August 2, 2008 how i can make it to shutdown pc after time what i insert in my label...but to don't use sleep() cuz if i use it i can close the gui:| i don't get how....some ideas please tnx Link to comment Share on other sites More sharing options...
Achilles Posted August 2, 2008 Share Posted August 2, 2008 how i can make it to shutdown pc after time what i insert in my label...but to don't use sleep() cuz if i use it i can close the gui:|i don't get how....some ideas pleasetnxSeveral things wrong with what you're thinking:1. You don't insert text into a label: Try the function GUICtrlCreateInput... examples are in the helpfile.2. You're GUI won't close when you click exit unless you tell it to.But, onto your problem...Look at the Shutdown command in the helpfile, it should do what you want. My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted August 2, 2008 Share Posted August 2, 2008 Instead of using Sleep() use _Timer_Init() and _Timer_Diff() or shutdown.exe .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
Kyme Posted August 2, 2008 Author Share Posted August 2, 2008 Several things wrong with what you're thinking: 1. You don't insert text into a label: Try the function GUICtrlCreateInput... examples are in the helpfile. 2. You're GUI won't close when you click exit unless you tell it to. But, onto your problem... Look at the Shutdown command in the helpfile, it should do what you want. i have make one but i have one err "Wend" statement with no matching "While" statement. what i wrong on it??? expandcollapse popup#include <GUIConstants.au3> Opt("TrayMenuMode",1) $Menu1 = GUICreate("Shut Down Slut!!!", 328, 245, -1, -1) GUISetState(@SW_HIDE) $exittray = TrayCreateItem("Exit") $abouttray = TrayCreateItem("About") $1 = TrayCreateItem("") $settings = TrayCreateItem("Settings") $1 = TrayCreateItem("") $start = TrayCreateItem("Strat") $Group1 = GUICtrlCreateGroup("Settings", 48, 24, 233, 169) GUICtrlSetColor(-1, 0xFF0000) $text1 = GUICtrlCreateLabel("Time Set(h):", 72, 48, 61, 17, $SS_CENTERIMAGE) $text2 = GUICtrlCreateLabel("Job Set:", 72, 80, 43, 17, $SS_CENTERIMAGE) $ringcheck = GUICtrlCreateCheckbox("Ring", 72, 120, 97, 17) $jobcheck = GUICtrlCreateCheckbox("Use Job", 72, 152, 97, 17) $timeset = GUICtrlCreateCombo("", 136, 48, 113, 25) GUICtrlSetData(-1, "1h|2h|3h|4h|5h") $jubset = GUICtrlCreateCombo("", 136, 80, 113, 25) GUICtrlSetData(-1, "Shutdown|Hibernate") GUICtrlCreateGroup("", -99, -99, 1, 1) While 1 $Msg = GUIGetMsg() $tray = TrayGetMsg() If $msg= $GUI_EVENT_CLOSE Then GUISetState(@SW_HIDE,$Menu1) EndIf If $tray=$settings Then GUISetState(@SW_SHOW,$Menu1) EndIf If $tray=$exittray Then Exit EndIf If $tray=$start Then If $tray=$exittray Then Exit EndIf If GUICtrlRead($timeset)="1h" Then Sleep(3600000) If GUICtrlRead($jubset)="Shutdown" Then If GUICtrlRead($ringcheck) = 1 Then Beep(5000,55000) Sleep(60000) Shutdown(9) EndIf Shutdown(9) ElseIf GUICtrlRead($jubset)="Hibernate" Then Shutdown(64) EndIf ElseIf GUICtrlRead($timeset)="2h"Then Sleep(7200000) If GUICtrlRead($jubset)="Shutdown" Then If GUICtrlRead($ringcheck) = 1 Then Beep(5000,55000) Sleep(60000) Shutdown(9) EndIf Shutdown(9) ElseIf GUICtrlRead($jubset)="Hibernate" Then Shutdown(64) EndIf ElseIf GUICtrlRead($timeset)="3h"Then Sleep(10800000) If GUICtrlRead($jubset)="Shutdown" Then If GUICtrlRead($ringcheck) = 1 Then Beep(5000,55000) Sleep(60000) Shutdown(9) EndIf Shutdown(9) ElseIf GUICtrlRead($jubset)="Hibernate" Then Shutdown(64) EndIf ElseIf GUICtrlRead($timeset)="5h"Then Sleep(18000000) If GUICtrlRead($jubset)="Shutdown" Then If GUICtrlRead($ringcheck) = 1 Then Beep(5000,55000) Sleep(60000) Shutdown(9) EndIf Shutdown(9) ElseIf GUICtrlRead($jubset)="Hibernate" Then Shutdown(64) EndIf EndIf WEnd Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted August 2, 2008 Share Posted August 2, 2008 (edited) That happens because of all the other errors you have, fix them and the WEnd will work. Edit: Also you should not use GUIConstants.au3, use GUIConstantsEx.au3 instead. Edited August 2, 2008 by AdmiralAlkex .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now