Sign in to follow this  
Followers 0
Vladi243

What's wrong with my script?

6 posts in this topic

#1 ·  Posted (edited)

#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

Share this post


Link to post
Share on other sites



not this one "$Second_Link_Input" , the input field doesnt exist?

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Thank you guys. I changed the names of the variables and forgot to change, thats why it made an error.

d4rk@

I can't find the IsPress() function in the help file. Are you sure that it exist?

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

ohhh... I found it. Thanks:)

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  
Followers 0