orlith Posted July 12, 2008 Share Posted July 12, 2008 Hi There After reading most of posts, i'm still noob muttley with GUI What I would like to do is a simple windows with a coutdown (30 s), a text message, and a cancel button. The purpose of this windows is to let the choice to a user to cancel the reboot of the computer during 30s. If he doesn't click the cancel button, the windows close and the computer reboot. The cancel button must be (in a perfect world) the only way to close the windows. After that I'll play and probably add a progress bar. any help will be welcome. thanks a lot Link to comment Share on other sites More sharing options...
Andreik Posted July 12, 2008 Share Posted July 12, 2008 (edited) Hi There After reading most of posts, i'm still noob muttley with GUI What I would like to do is a simple windows with a coutdown (30 s), a text message, and a cancel button. The purpose of this windows is to let the choice to a user to cancel the reboot of the computer during 30s. If he doesn't click the cancel button, the windows close and the computer reboot. The cancel button must be (in a perfect world) the only way to close the windows. After that I'll play and probably add a progress bar. any help will be welcome. thanks a lot#include <Process.au3> $GUI = GUICreate("Restart...",200,200,-1,-1,0x16C80000,00000188) $LABEL = GUICtrlCreateLabel("Click cancel if you don't want to restart your computer",5,5,190,50,0x01) $PROGRESS = GUICtrlCreateProgress(5,65,190,20) $BUTTON = GUICtrlCreateButton("CANCEL",50,150,100,30) GUISetState(@SW_SHOW) $TIME = TimerInit() While 1 If GUIGetMsg() = $BUTTON Then Exit EndIf GUICtrlSetData($PROGRESS,Int(TimerDiff($TIME)/1000*3.33333)) If TimerDiff($TIME) >= 30000 Then _RunDOS("shutdown -r -f") EndIf WEnd Edited July 13, 2008 by Andreik When the words fail... music speaks. Link to comment Share on other sites More sharing options...
picaxe Posted July 13, 2008 Share Posted July 13, 2008 I've used a modified version of this by CyberSlug Link to comment Share on other sites More sharing options...
orlith Posted July 13, 2008 Author Share Posted July 13, 2008 Hi Greats thanks to both. I'll learn from that ! 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