Chetwood Posted October 19, 2004 Share Posted October 19, 2004 I'd like to use the shutdown function in my script and offer the user a chance to interrupt the process in case he's changed his mind. I've tried to use the Progressbar function which would suit me fine but there's no way to cancel it. I just wanted to make sure there's no function I've overlooked before fiddling around and creating my own window that shows a thin progress bar and counts down from 60 seconds offering a cancel button. Thanks. MultiMakeMKV: batch processing for MakeMKV (Win)MultiShrink: batch processing for DVD ShrinkOffizieller Übersetzer von DVD Shrink deutsch Link to comment Share on other sites More sharing options...
this-is-me Posted October 19, 2004 Share Posted October 19, 2004 On XP, execute the following command line: shutdown -s -t 60 and cancel with shutdown -a otherwise, you will have to go with guicreate. Who else would I be? Link to comment Share on other sites More sharing options...
Chetwood Posted October 20, 2004 Author Share Posted October 20, 2004 (edited) On XP, execute the following command line:<{POST_SNAPBACK}>Yes, I'd thought about using that too but I won't force ppl to use XP to run my script, they should be able to use 98/W2K as well. So I'm looking for another way to do it. Currently I'm trying to do a simple countdown window without a progress bar but it does not work properly. Edited October 20, 2004 by Chetwood MultiMakeMKV: batch processing for MakeMKV (Win)MultiShrink: batch processing for DVD ShrinkOffizieller Übersetzer von DVD Shrink deutsch Link to comment Share on other sites More sharing options...
sPeziFisH Posted October 20, 2004 Share Posted October 20, 2004 It's not that hard, progressbar, cancel-button, etc., the new GUI-functions are great.Inspirate yourself by CyberSlug's old code if you're not that good in AutoIt yet.Here you can find different windows-shutdown-methods or google for a small freeware shutdown-utility and use it.Good Luck Link to comment Share on other sites More sharing options...
jpm Posted October 20, 2004 Share Posted October 20, 2004 I'd like to use the shutdown function in my script and offer the user a chance to interrupt the process in case he's changed his mind. I've tried to use the Progressbar function which would suit me fine but there's no way to cancel it. I just wanted to make sure there's no function I've overlooked before fiddling around and creating my own window that shows a thin progress bar and counts down from 60 seconds offering a cancel button. Thanks.<{POST_SNAPBACK}>here follow a AutoIt script which can do what you need I hope #include <Constants.au3>#include <GuiConstants.au3>$code = $SD_SHUTDOWN$Elapse= 60000 ; 60 secondsGUICreate ("shutdown",220,100)$progress=GUICtrlCreateProgress (10, 10, 200,20)$cancel=GUICtrlCreateButton ("Cancel",50,50, 100)$state=GUICtrlCreateLabel ("Windows is shutting down...",50,50, 150)GuiCtrlSetState (-1, $GUI_HIDE)GuiSetState()$start=TimerStart()Do $msg=GuiGetMsg() $diff=TimerDiff($start) if $diff>=$elapse then Shutdown($code) GuiCtrlSetState($cancel, $GUI_HIDE) GuiCtrlSetState($state, $GUI_SHOW); exit EndIf Sleep (100) GuiCtrlSetData($progress, $diff*100/$elapse) Until $msg=$GUI_EVENT_CLOSE OR $msg= $cancel 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