Jump to content
Sign in to follow this  
Aston1X

Using the 'If' command. Help.

Recommended Posts

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 by Aston1X

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 :idea:

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...