Aston1X Posted May 22, 2010 Posted May 22, 2010 (edited) So, I'm new to AutoIT so just messing about with GUI at the moment. I have a box with Start and Exit buttons. The exit button exits but I can't seem to work out how to get the Start button to start the script written out below. This is where I'm at now.. #include <IE.au3> #include <GUIConstants.au3> GUICreate("--", 614, 160) GUISetFont(9, 400, -1, "comic sans ms") GUISetState() $B_oIE1 = ObjCreate("Shell.Explorer.2") $Breaktime = GUICtrlCreateObj($B_oIE1, -1, -1, 500, 370) $BrkStart = GUICtrlCreateButton("&Start", 515, 40, 80, 25) $BrkEnd = GUICtrlCreateButton("&Exit", 515, 90, 80, 25) $html = "about: Start or Exit. That is the question." & @CR $B_oIE1.navigate ( $html) While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Or $msg = $BrkEnd Then Exit EndIf If $msg = $BrkStart And IsObj($B_oIE1) Then <need help at this bit> EndIf WEnd p.s. I know this can just be down with batch file command shutdown -s. Much help appreciated Edited May 22, 2010 by Aston1X
99ojo Posted May 22, 2010 Posted May 22, 2010 Hi, if you want to shutdown computer, have a look at helpfile: Function shutdown (). If you want to do something else or if you have other problems, be mor precise. ;-)) Stefan
Aston1X Posted May 22, 2010 Author Posted May 22, 2010 Well, I'm wanting to create a script which will open up all the websites I want when I log on in the morning. I know how to open a browser and get all my pages up, it's just I want a GUI with Start and Exit in case I don't want it running as I will be placing the script in my StartUp files. So, at the bit ' If $msg = $BrkStart And IsObj($B_oIE1) Then <need help at this bit> EndIf ' I'm trying to find out how to tell it to run the script to open all my pages if I hit Start. Hope this helps you help me
JohnOne Posted May 22, 2010 Posted May 22, 2010 If $msg = $BrkStart And IsObj($B_oIE1) Then _YourFunction() Endif You need to create a function and that will invoke it. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
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