Jump to content
Sign in to follow this  
Maffe811

_IEImgClick and the console goes crazy!

Recommended Posts

Maffe811

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>

Opt('MustDeclareVars', 1)

Example()

; Simple example: Embedding an Internet Explorer Object inside an AutoIt GUI
;
; See also: http://msdn.microsoft.com/workshop/browser/webbrowser/reference/objects/internetexplorer.asp
Func Example()
    Local $oIE, $GUIActiveX, $msg, $button
    Local $width = 600
    Local $height = 400

    $oIE = ObjCreate("Shell.Explorer.2")


    ; Create a simple GUI for our output
    GUICreate("Embedded Web control Test",600,400, -1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS, $WS_CLIPCHILDREN))
    $button = GUICtrlCreateButton("Home",10,350,100,40)
    $GUIActiveX = GUICtrlCreateObj ($oIE,-5,-5,600,340)

    GUISetState()       ;Show GUI

    $oIE.navigate("http://www.autoitscript.com/forum/forum-1/announcement-13-forum-rules/")


    ; Waiting for user to close the window
    While 1
        $msg = GUIGetMsg()

        Select
            Case $msg = $GUI_EVENT_CLOSE
                ExitLoop

            Case $button
                _IEImgClick ( $GUIActiveX, "http://www.autoitscript.com/forum/public/style_images/autoit/logo.png","src")

        EndSelect

    WEnd

    GUIDelete()
EndFunc   ;==>Example

Thats my code, and this is what happens in the console:

--> IE.au3 V2.4-0 Error from function _IEImgClick, $_IEStatus_InvalidDataType

I dont understand whats wrong...


[font="helvetica, arial, sans-serif"]Hobby graphics artist, using gimp.Automating pc stuff, using AutoIt.Listening to music, using Grooveshark.[/font]Scripts:[spoiler]Simple ScreenshotSaves you alot of trouble when taking a screenshot!Don't remember what happened with this, but aperantly the exe is all i got.If you don't want to run it, simply don't._IsRun UDFIt figures out if the script has ben ran before based on the info in a ini file.If you don't want to use exactly what i wrote, you can use it as inspiration.[/spoiler]

Share this post


Link to post
Share on other sites
BitByteBit

You're need to use the IE object.

The code below will error unless you wait for the page to load.

_IEImgClick($oIE, "http://www.autoitscript.com/forum/public/style_images/autoit/logo.png","src")

Share this post


Link to post
Share on other sites
Maffe811

But its a button...

I wait until the page is laoded and then i click the button.

But console goes crazy from the second i start the script!

But i got my old code back so im gonna try to do it with that!


[font="helvetica, arial, sans-serif"]Hobby graphics artist, using gimp.Automating pc stuff, using AutoIt.Listening to music, using Grooveshark.[/font]Scripts:[spoiler]Simple ScreenshotSaves you alot of trouble when taking a screenshot!Don't remember what happened with this, but aperantly the exe is all i got.If you don't want to run it, simply don't._IsRun UDFIt figures out if the script has ben ran before based on the info in a ini file.If you don't want to use exactly what i wrote, you can use it as inspiration.[/spoiler]

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  

×