Jump to content

What's wrong with my script?


Recommended Posts

#include <GUIConstants.au3>
#include <IE.au3>

_IEErrorHandlerRegister ()

Global $oIE1 = _IECreateEmbedded ()
Global $oIE2 = _IECreateEmbedded ()
Global $Browser, $First_Group, $GUIActiveX1, $First_Link_Label, $First_Link_Input, $Surf1_Button, $Second_Group, $GUIActiveX2, _
$Input1, $Label1, $Surf2_Button, $Hide, $Minimize_To_Tray, $GUICtrlReadFirstLink, $GUICtrlReadSecondLink

#Region ### START Koda GUI section ### Form=D:\Vladik\Autoit\koda_1.7.0.1\Forms\Browser.kxf
$Browser = GUICreate("Browser", 651, 483, 186, 146)
$First_Group = GUICtrlCreateGroup("First Surf Page", 8, 10, 633, 210)
$GUIActiveX1 = GUICtrlCreateObj($oIE1, 25, 50, 600, 160)
$First_Link_Label = GUICtrlCreateLabel("Link", 24, 28, 28, 20)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$First_Link_Input = GUICtrlCreateInput("", 56, 26, 488, 21)
$Surf1_Button = GUICtrlCreateButton("Surf", 554, 26, 80, 21, 0)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Second_Group = GUICtrlCreateGroup("Second Surf Page", 8, 230, 633, 210)
$GUIActiveX2 = GUICtrlCreateObj($oIE2, 25, 270, 600, 160)
$Input1 = GUICtrlCreateInput("", 56, 246, 488, 21)
$Label1 = GUICtrlCreateLabel("Link", 24, 248, 28, 20)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$Surf2_Button = GUICtrlCreateButton("Surf", 554, 246, 80, 21, 0)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Hide = GUICtrlCreateButton("Hide the browser", 540, 450, 102, 25, 0)
$Minimize_To_Tray = GUICtrlCreateButton("Minimize to tray", 420, 450, 102, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

HotKeySet ("{F5}", "ShowGUI")

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $Surf1_Button
            $GUICtrlReadFirstLink = GUICtrlRead ($First_Link_Input)
            _IENavigate ($oIE1, $GUICtrlReadFirstLink)
        Case $msg = $Surf2_Button
            $GUICtrlReadSecondLink = GUICtrlRead ($Second_Link_Input)                
            _IENavigate ($oIE2, $GUICtrlReadSecondLink)
        Case $msg = $Hide
            GUISetState(@SW_HIDE)
            TraySetState (2)
            MsgBox (1, "Hidden Browser", "Your Browser is hidden. Press F5 to show it again")
        Case $msg = $Minimize_To_Tray
            GUISetState(@SW_HIDE)
    EndSelect
WEnd

GUIDelete()
exit

Func ShowGUI()
    GUISetState(@SW_SHOW)
    TraySetState (1)
EndFunc

When I click on the second surf button, it makes an error "The variable isn't declared". ammm... I declared all the variables. What's the problem?

Another problem: As you see, I made a hotkey in order to open the GUI from the hidden mode. I want to make that it show the GUI when I press on ctrl+shift+s, but I can't do it with HotKeySet(). Which function should I use?

Edited by Vladi243
Link to comment
Share on other sites

1.Ah yes, i see you forget to declare $Second_Link_Input, add it then everything works fine

2.

if IsPress() And IsPress() And IsPress()

[quote]Don't expect for a perfect life ... Expect a least troubles ones[/quote]Contact me : ass@kiss.toWhat I Have Done :Favorites Manager Mangage your favorite's folder, that's coolPC Waker For those who want to save stickersWebScipts Supporter For those who've just started with Web and WebScriptsTemporary Looker Simple but powerful to manage your Temporary folder, you know what you downloaded[UDF] _NumberFormat() Better performance on number display[UDF] _DirGet() What a folder contain [how many (hidden,normal,...) files], with one line of code[UDF] _IsPressEs() Just like _IsPress() but for a group of keys

Link to comment
Share on other sites

that's my typo , it's _IsPress()

[quote]Don't expect for a perfect life ... Expect a least troubles ones[/quote]Contact me : ass@kiss.toWhat I Have Done :Favorites Manager Mangage your favorite's folder, that's coolPC Waker For those who want to save stickersWebScipts Supporter For those who've just started with Web and WebScriptsTemporary Looker Simple but powerful to manage your Temporary folder, you know what you downloaded[UDF] _NumberFormat() Better performance on number display[UDF] _DirGet() What a folder contain [how many (hidden,normal,...) files], with one line of code[UDF] _IsPressEs() Just like _IsPress() but for a group of keys

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...