Jump to content

Basic IE.udf use


Newb
 Share

Recommended Posts

It's the whole afternoon I'm trying to figure out how to use IE.Au3 functions.

I need to embed a page into a GUI and put some buttons to make some repetitive tasks no worry, while I'm doing something else. In particular, checking my google mail account would be nice, but I'm extending this to all the purposes, in case I would need to know how to do it, for any future script :x

So how for example how i do automatically select and click the Search button in google main page? Or for example how i click a link in the page? Or for example how i can search thru the page for a particular written phrase (Like "You have new mail!" or so)?

So far this is what I managed to understand and code:

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

Global $oIE = ObjCreate("Shell.Explorer.2")
GUICreate("MailChecker", 801, 601, 213, 139)
Global $Obj = GUICtrlCreateObj($oIE,  304, 8, 489, 585)
$Esci = GUICtrlCreateButton("Esci", 8, 560, 289, 33, $WS_GROUP)
GUICtrlCreateTab(8, 16, 289, 537)
GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
GUICtrlCreateTabItem("Mail Options")
GUICtrlCreateTabItem("Settings")
GUICtrlCreateTabItem("")
GUISetState(@SW_SHOW)
$oIE.navigate("http://www.google.com/")
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
        Case $Esci
            $oLogin=_IEGetObjByName($oIE,"I'm feeling lucky")
            _IEAction($oLogin,"Click")
            Exit

    EndSwitch
WEnd

Pressing Esci button should click on "I'm feeling lucky button", but, this clearly seems the wrong way to do it.... I guessed it should be so because in help it's made very simple:

At _IeGetObjByName there is this far too simple example

#include <IE.au3>
$oIE = _IE_Example ("form")
$oForm = _IEGetObjByName ($oIE, "ExampleForm")

That make it seems like you just put the name of the button or the text you want to click on and you get it.

EDIT: I found that button code is in the HTML, but i have to deal with a nameless button: <input type=submit value=Go!> this is his html code, how to click this?

So, how in my source code, i can click on "Google Search" or "I'm feeling lucky" and do all the previous asked things?

Thanks in advance

Edited by Newb

I'm a compulsive poster. When I post something, come to read it at least 5 minutes later after the posting, because I will edit it. I edited even this signature a few minutes later after I wrote it.

Link to comment
Share on other sites

Try opening the UDF and look at the comments in there. They tell you how to use the software. If you then have a problem, come back and run it by us again.

[font="Comic Sans MS"]My code does not have bugs! It just develops random features.[/font]My Projects[list][*]Live Streaming (Not my project, but my edited version)[right]AutoIt Wrappers![/right][/list]Pure randomness[list][*]Small Minds.......................................................................................................[size="1"]Simple progress bar that changes direction at either sides.[/size][*]ChristmasIt AutoIt Christmas Theme..........................................................[size="1"]I WAS BOOOORED![/size][*]DriveToy..............................................................................................................[size="1"]Simple joke script. Trick your friends into thinking their computer drive is haywire![/size][/list]In Development[list][*]Your Background Task Organiser[*]AInstall Second Generation[/list]BEFORE POSTING ON THE FORUMS, TRY THIS:

%programfiles%/AutoIt3/autoit3.chm
Link to comment
Share on other sites

Try opening the UDF and look at the comments in there. They tell you how to use the software. If you then have a problem, come back and run it by us again.

Well, you're not exactly helpful. I've already done that, along with forum search, that's why I'm now here asking.

Try to see for _IECreateEmbedded Function for starting ! Posted Image

If you looked at the source, I had already embedded a page in the GUI without the need of IE.au3, now I'm concerned about buttons and retrieving elements in a web page

I'm a compulsive poster. When I post something, come to read it at least 5 minutes later after the posting, because I will edit it. I edited even this signature a few minutes later after I wrote it.

Link to comment
Share on other sites

This is the HTML source of the button with some extra code in case it might help:

<div id='left-box'>

<div class='inner'>

<fieldset>

<legend width='150'><b>Login</b></legend><font style='font-style: small; font-family: verdana, arial, sans-serif; font-size: 10px'>

<form action=authenticate.php method=post name=login onsubmit="return saveme();">

User: <input type=text name=username><br>

Password: <input type=password name=password><br>

Remember me??<br />

<input type="radio" value="ON" name="save">Yes <input type="radio" name="save" value="OFF" checked>No

<input type=submit value=Go!></form>

<a href='reminder.php'>Forgot Password?</a></fieldset>

<p><li><b>Don't have an account?</b></li><li><b> Sign up now for free!!</b></li></p>

So, how can i get to click into the "Go!" Button? (Colored in red in the source

I tried to search forum, to get help from friends but noone was able to do it...

I'm a compulsive poster. When I post something, come to read it at least 5 minutes later after the posting, because I will edit it. I edited even this signature a few minutes later after I wrote it.

Link to comment
Share on other sites

<input name="btnI" type="submit" value="I'm Feeling Lucky" class="lsb">

_IEGetObjByName need a name not a value !

Try $oLogin=_IEGetObjByName ( $oIE, "btnI" ) Posted Image

Good, thanks.

What about that nameless button? How can i Intercept it?

I'm a compulsive poster. When I post something, come to read it at least 5 minutes later after the posting, because I will edit it. I edited even this signature a few minutes later after I wrote it.

Link to comment
Share on other sites

See _IEFormElementGetCollection

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

See

Dale

How?

Tried to read the help file and closed it after 3 seconds. Possibly the worst explanation in the whole help file... Had to guess myself how to get _IEFormGetCollection and _IEFormElementGetCollection and still not figured it out the whole thing. Tell who wrote that to fully rewrite it. Seriously.

Except from this i got that Ieformgetcollection is for finding various forms in a page. If i have a login form, it takes the whole login field, no matter how much form elements are into it and counts 1 Form.

Then with IeFormElementGetCollection you should get ???? A LIST????? of the elements in it...

Really bad explained.... What are elements for him? Radios? Editable areas? Radio Buttons? Buttons? WHO KNOWS!

Other mysterious thing is how he stores the elements list.... Array? Numbers? Strings, again, WHO KNOWS!

From the help example:

; *******************************************************
; Example 1 - Get a reference to a specific form element by 0-based index.
;               In this case, submit a query to the Google search engine
; *******************************************************
;
#include <IE.au3>
$oIE = _IECreate ("http://www.google.com")
$oForm = _IEFormGetCollection ($oIE, 0)
$oQuery = _IEFormElementGetCollection ($oForm, 2)
_IEFormElementSetValue ($oQuery, "AutoIt IE.au3")
_IEFormSubmit ($oForm)

He called $oQuery = _IEFormElementGetCollection ($oForm, 2) just putting that 2 there, not explaining what it is.... By guessing i would say it's the 3rd (0= 1st element, 1= 2nd element, 2= third ????) element found in the form.... BUT HOW CAN I KNOW??? He don't explain nothing, and experimenting randomly with the code brings to nothing, along with opening IE.au3 and checking...

Help please???

I'm a compulsive poster. When I post something, come to read it at least 5 minutes later after the posting, because I will edit it. I edited even this signature a few minutes later after I wrote it.

Link to comment
Share on other sites

I wrote it. Go crawl in a hole and die. When you are reincarnated into a higher life form you may have the skill to read the helpfile, follow the references it makes to related functions, run the examples, and perhaps the grace to not piss off the people you are trying to get to spend their free time helping you learn the language.

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

Thanks, very kind language, i like it. Now that I see how you accept criticism I understand why that help section wasn't so good.

Anyway, after 3h and half of testing it, i got it to work in some way.

so this is the code of what i got:

Func _Login()
    _IELoadWait($oIE)
    Local $oLogForm = _IEFormGetCollection ($oIE,0)
    Local $oFormUser=_IEFormElementGetCollection ($oLogForm,0)
    Local $oFormPass=_IEFormElementGetCollection ($oLogForm,1)
    _IEFormElementSetValue($oFormUser,GUICtrlRead($UserInp))
    _IEFormElementSetValue($oFormPass,GUICtrlRead($PassInp))
    _IEFormSubmit($oLogForm)
EndFunc

Which is practically IDENTICAL to the one of the help file for _IEFormGetCollection, first example

But, I get this:

--> IE.au3 V2.4-0 Error from function _IEFormSubmit, $_IEStatus_InvalidObjectType

All runs fine before that. Script waits for loading page, forms get filled, but submit doesn't work.

Well... why?

EDIT:

Strange things happens... Now it doesn't give errors at all, but first of all, I can't even click it by myself.

I think i got what's the problem.

Look at this picture:

Posted Image

As you can see the button is very different when it is into an Interner explorer window from when it's embedded in a Autoit GUI like in my script.

In the Internet explorer window i can do all the normal things i do like selecting it with tab and click it to login.

Into the autoit GUI it loses its "windows style" (I don't know how else i can call it) and you can't TAB switch to it, you can't find it with IE functions and you can't even click it by yourself.... It's like you press it but nothing happens. Any clue of what happens ?

:x:P:shifty::nuke:

Edited by Newb

I'm a compulsive poster. When I post something, come to read it at least 5 minutes later after the posting, because I will edit it. I edited even this signature a few minutes later after I wrote it.

Link to comment
Share on other sites

Your attitude is not going to get you far here. This is a volunteer community and you are asked for nothing in return for our time other than your respect and an honest effort.

The indiviual function documentation for IE.au3 does not live in issolation. That said, I have insured that every example is a full, stand-alone demonstration of the function, so if you take the effort to actually run the example and learn from it and then do the same with the related function references, you will get what you need. In addition, there are literally thousands of references in the support forum to the functions you are trying to use and you will find a very rich learning bed by using Search.

Look carefully at the IE.au3 message you received from the console. What do you think it means?

Dale

Edit: spelling

Edited by DaleHohm

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

Your attitude is not going to get you far here. This is a volunteer community and you are asked for nothing in return for our time other than your respect and an honest effort.

The indiviual function documentation for IE.au3 does not live in issolation. That said, I have insured that every example is a full, stand-alone demonstration of the function, so if you take the effort to actually run the example and learn from it and then do the same with the related function references, you will get what you need. In addition, there are literally thousands of references in the support forum to the functions you are trying to use and you will find a very rich learning bed by using Search.

Look carefully at the IE.au3 message you received from the console. What do you think it means?

Dale

Edit: spelling

I help people too when I know the answer, so I do "Honest efforts" too, and I do it for free too.

I don't know what that message means, otherwise i wouldn't be here asking.

Moreover it seems only a Autoit limitation problem, as shows the image above, because the button doesn't get embedded correctly into the GUI, because i can't even click it manually (into the embedded GUI page) while into the IE windows it works fine. Only solution i see for now it's sending a HTTP request with name and password in it, which it means that i have to learn another au3 :x

Any suggestion?

I'm a compulsive poster. When I post something, come to read it at least 5 minutes later after the posting, because I will edit it. I edited even this signature a few minutes later after I wrote it.

Link to comment
Share on other sites

You conveniently skipped over the respect part.

You don't understand what that message means? If you have no idea, you are not yet making an honest effort. Tear it apart:

--> IE.au3 V2.4-0

Error from function _IEFormSubmit,

$_IEStatus_

InvalidObjectType

means you passed an object, but not the right type of object.

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

At _IeGetObjByName there is this far too simple example

#include <IE.au3>
$oIE = _IE_Example ("form")
$oForm = _IEGetObjByName ($oIE, "ExampleForm")

That make it seems like you just put the name of the button or the text you want to click on and you get it.

EDIT: I found that button code is in the HTML, but i have to deal with a nameless button: <input type=submit value=Go!> this is his html code, how to click this?

So, how in my source code, i can click on "Google Search" or "I'm feeling lucky" and do all the previous asked things?

Thanks in advance

To see the elements of a source code more organized you can use Debugbar or Firebug. Also there is that shows you the forms of a webpage with its index. For more useful tools check DaleHohm' signature :P As you discovered (I suppose because of your edit) the 'name' of the button is not what you see in the webpage but the name attribute of an element in the source code.

Concerning dealing with a nameless button as <input type=submit value=Go!> you can try _IETagNameGetCollection and get all input tags and then do something like

For $oinput In $oinputs
   If stringinstr($oinput.innertext,'value=Go!') then;you can also use _IEPropertyGet if this doesn't function
      $myobject = $oinput
      ExitLoop
   EndIf
Next

But if what you are trying to do is click the google search there's an example of that in the help file, I commented them a bit more to explain the concepts of the attributes:

; *******************************************************

; Example 1 - Get a reference to a specific form element by 0-based index.

; In this case, submit a query to the Google search engine

; *******************************************************

;

#include <IE.au3>

$oIE = _IECreate ("http://www.google.com")

$oForm = _IEFormGetCollection ($oIE, 0);as the form is the first in the page, its index is 0

$oQuery = _IEFormElementGetCollection ($oForm, 2);gets an object reference to the element in the form whose index is 2

_IEFormElementSetValue ($oQuery, "AutoIt IE.au3")

_IEFormSubmit ($oForm)

; *******************************************************

; Example 1 - Get a reference to a specific form element by name.

; In this case, submit a query to the Google search engine

; *******************************************************

;

#include <IE.au3>

$oIE = _IECreate ("http://www.google.com")

$oForm = _IEFormGetObjByName ($oIE, "f");gets an object reference to the form whose name attribute is 'f',(you can see it in debugbar)

$oQuery = _IEFormElementGetObjByName ($oForm, "q");gets an object reference to the element in the form whose name is 'q',(you can see it in debugbar)

_IEFormElementSetValue ($oQuery, "AutoIt IE.au3")

_IEFormSubmit ($oForm)

Finally if you experience problems using _IEFormSubmit remember this remark:

For many HTML forms it is not sufficient to use _IEFormSubmit() because there is often custom Javascript tied to an onclick event for its Submit button. In these cases you'll need to simulate a click of the submit button instead of using _IEFormSubmit(). See the example for the "click" action of _IEAction().

As well, some form processing relies on the "value" of the submit button being passed along with the rest of the form data (often when there is more than one submit button in the form and they are designed to trigger different results). This function will not result in a submit button value being passed. The solution is to use the "click" action of _IEAction() as above.

If you experience trouble with the automatic _IELoadWait called by default, please set $f_wait parameter to 0 and call _IELoadWait from your script, passing it the InternetExplorer object.

In a nutshell if when looking at the source code with debug bar for example, you see that the form code has something like

<FORM name=jumpbox onsubmit="if(document.jumpbox.f.value == -1){return false;}"

(could be also onclick as the remark says) you may need to get a reference to the submit button and then fire the onsubmit/onclick event:

$oButton.fireEvent("onclick")

$oButton.click

Hey, I found a similar doubt here:

Also this may be helpful:

I hope this get you going, in any case ask again :x .

PS: Let's get on well, DaleHohm helped me a lot of times, and I know he put a lot of effort in the UDF. However, I can understand the frustration when things don't function as you intended them to function but in that case 'blame the code not the coders' :shifty: . Seriously, all people here want to help you so let's continue helping between us in this great communnity!

Link to comment
Share on other sites

To see the elements of a source code more organized you can use [url="http://www.debugbar.com

ETC ETC.

Thanks again for the detailed reply, but before losing other 4 hours in various testing, I would make you notice my previous post:

Look at this picture:

Posted Image

As you can see the button is very different when it is into an Interner explorer window from when it's embedded in a Autoit GUI like in my script.

In the Internet explorer window i can do all the normal things i do like selecting it with tab and click it to login.

Into the autoit GUI it loses its "windows style" (I don't know how else i can call it) and you can't TAB switch to it, you can't find it with IE functions and you can't even click it by yourself.... It's like you press it but nothing happens. Any clue of what happens ?

:x:P:shifty::nuke:

It seems more an autoit object handling problem to me that something else. in fact if you look at the image, you see that when I embedded the same page in autoit the button became "different". It lose it's "Windows XP smooth stile" and became dark grey. Moreover, while it's embedded in the autoit gui, I can't click it even manually, it's like disabled. Instead, if i open the same link in a normal internet explorer page, it works like it should be, the button have it's smooth shape and white colour, and i can click and switch to it even with TAB button.

So at the end, it seems like IE.au3 or autoit are missing something, I don't know. Do you have any clue of what it can be?

Only solution i see so far, it seems sending directly the http request with login and password since in the code i see:

<fieldset>

<legend width='150'><b>Login</b></legend><font style='font-style: small; font-family: verdana, arial, sans-serif; font-size: 10px'>

<form action=authenticate.php method=post name=login onsubmit="return saveme();">

User: <input type=text name=username><br>

Password: <input type=password name=password><br>

Remember me??<br />

<input type="radio" value="ON" name="save">Yes <input type="radio" name="save" value="OFF" checked>No

<input type=submit value=Go!></form>

<a href='reminder.php'>Forgot Password?</a></fieldset>

and with a simple firefo extension to intercept http traffic i can send, intercept or modify them, i guess it's possible to do the same with autoit...

Edited by Newb

I'm a compulsive poster. When I post something, come to read it at least 5 minutes later after the posting, because I will edit it. I edited even this signature a few minutes later after I wrote it.

Link to comment
Share on other sites

So at the end, it seems like IE.au3 or autoit are missing something, I don't know. Do you have any clue of what it can be?

You really need more programming experience. When you get it you will laugh to most of the things you've written here. And you will see very basic mistakes in your current reasoning.

Anyway, good luck learning.

Link to comment
Share on other sites

You really need more programming experience. When you get it you will laugh to most of the things you've written here. And you will see very basic mistakes in your current reasoning.

Anyway, good luck learning.

Well, i admit that I'm a noob at programming for now. Could you enlight me about that changed button?

I'm a compulsive poster. When I post something, come to read it at least 5 minutes later after the posting, because I will edit it. I edited even this signature a few minutes later after I wrote it.

Link to comment
Share on other sites

Thanks again for the detailed reply, but before losing other 4 hours in various testing, I would make you notice my previous post:

It seems more an autoit object handling problem to me that something else. in fact if you look at the image, you see that when I embedded the same page in autoit the button became "different". It lose it's "Windows XP smooth stile" and became dark grey. Moreover, while it's embedded in the autoit gui, I can't click it even manually, it's like disabled. Instead, if i open the same link in a normal internet explorer page, it works like it should be, the button have it's smooth shape and white colour, and i can click and switch to it even with TAB button.

So at the end, it seems like IE.au3 or autoit are missing something, I don't know. Do you have any clue of what it can be?

I am not experienced with GUIs but maybe the problem is at the beginning when you created the embedded page by using Global $oIE = ObjCreate("Shell.Explorer.2")

I mean, you didn't use an IE.au3 method to create the object you are going to embed afterwards and then you want to use IE.au3 functions on it. Have you tried using

$oIE = _IECreateEmbedded () to embed it instead?.

By the way, I tried the example of _IECreateEmbedded ():

; *******************************************************
; Example 1 - Trap COM errors so that 'Back' and 'Forward' 
;               outside of history bounds does not abort script 
;               (expect COM errors to be sent to the console)
; *******************************************************
;
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>

_IEErrorHandlerRegister ()

$oIE = _IECreateEmbedded ()
GUICreate("Embedded Web control Test", 640, 580, _
        (@DesktopWidth - 640) / 2, (@DesktopHeight - 580) / 2, _
        $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN)
$GUIActiveX = GUICtrlCreateObj($oIE, 10, 40, 600, 360)
$GUI_Button_Back = GUICtrlCreateButton("Back", 10, 420, 100, 30)
$GUI_Button_Forward = GUICtrlCreateButton("Forward", 120, 420, 100, 30)
$GUI_Button_Home = GUICtrlCreateButton("Home", 230, 420, 100, 30)
$GUI_Button_Stop = GUICtrlCreateButton("Stop", 340, 420, 100, 30)

GUISetState()       ;Show GUI

_IENavigate ($oIE, "http://www.autoitscript.com")

; Waiting for user to close the window
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $GUI_Button_Home
            _IENavigate ($oIE, "http://www.autoitscript.com")
        Case $msg = $GUI_Button_Back
            _IEAction ($oIE, "back")
        Case $msg = $GUI_Button_Forward
            _IEAction ($oIE, "forward")
        Case $msg = $GUI_Button_Stop
            _IEAction ($oIE, "stop")
    EndSelect
WEnd

GUIDelete()

Exit

and it didn't navigate to the autoitpage. Does anyone know where to get the last IE.au3? or maybe a modified version I remember someone made cause he/she says something about internet explorer modifications that affected the UDF. I searched in topics made by DaleHohm but didn't find any discussion thread about the UDF.

Edited by Mithrandir
Link to comment
Share on other sites

I am not experienced with GUIs but maybe the problem is at the beginning when you created the embedded page by using Global $oIE = ObjCreate("Shell.Explorer.2")

I mean, you didn't use an IE.au3 method to create the object you are going to embed afterwards and then you want to use IE.au3 functions on it. Have you tried using

$oIE = _IECreateEmbedded () to embed it instead?.

By the way, I tried the example of _IECreateEmbedded ():

; *******************************************************
; Example 1 - Trap COM errors so that 'Back' and 'Forward' 
;               outside of history bounds does not abort script 
;               (expect COM errors to be sent to the console)
; *******************************************************
;
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>

_IEErrorHandlerRegister ()

$oIE = _IECreateEmbedded ()
GUICreate("Embedded Web control Test", 640, 580, _
        (@DesktopWidth - 640) / 2, (@DesktopHeight - 580) / 2, _
        $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN)
$GUIActiveX = GUICtrlCreateObj($oIE, 10, 40, 600, 360)
$GUI_Button_Back = GUICtrlCreateButton("Back", 10, 420, 100, 30)
$GUI_Button_Forward = GUICtrlCreateButton("Forward", 120, 420, 100, 30)
$GUI_Button_Home = GUICtrlCreateButton("Home", 230, 420, 100, 30)
$GUI_Button_Stop = GUICtrlCreateButton("Stop", 340, 420, 100, 30)

GUISetState()       ;Show GUI

_IENavigate ($oIE, "http://www.autoitscript.com")

; Waiting for user to close the window
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $GUI_Button_Home
            _IENavigate ($oIE, "http://www.autoitscript.com")
        Case $msg = $GUI_Button_Back
            _IEAction ($oIE, "back")
        Case $msg = $GUI_Button_Forward
            _IEAction ($oIE, "forward")
        Case $msg = $GUI_Button_Stop
            _IEAction ($oIE, "stop")
    EndSelect
WEnd

GUIDelete()

Exit

and it didn't navigate to the autoitpage. Does anyone know where to get the last IE.au3? or maybe a modified version I remember someone made cause he/she says something about internet explorer modifications that affected the UDF. I searched in topics made by DaleHohm but didn't find any discussion thread about the UDF.

I tried immediately and this is the result:

Posted Image

Nothing! :P

Tried to modify both my own script and the example given in help file, and that button still remains like that.

If I click GO! manually when there is no user and password a java error pops up saying that user and pass fields cannot be empty, but when i type in something and press GO! Nothing happens.

It seems like since Java code is stored in that page, it checks for empty login fields, but when i try to go with the http request for login, it doesn't send it.

So at the end, it still doesn't work, I still think the problem is autoit implementation with Internet explorer.

Solution doesn't seem solvable with code since the button doesn't work. Only way i can think of, is making directly a HTTP request with some http au3...

Do you agree? Where i can find such UDF in the forum? I saw one but it was very advanced, im looking for a simpler one (Like Ie.au3 cares of all the com objects thing)

Or, If you have any other solution, you're welcome...

EDIT: IMPORTANT

IT'S NOT AUTOIT FAULT, IT'S MY COMPUTER (NOT ME)

I sent the code to a friend of mine, he run it, and it worked fine on his computer.

At this point i think i have to reinstall IE or something like that....

Hironically, i'm the creator of the script and the only person who can't run it.... 3 friends of mine runs it fine

:shifty::nuke::lol: GRRRRRR DAMN IE! And to make more funny it doesn't work just in the script, whereas in normal internet explorer all works fine.... Sorry for blaming autoit guys!

EDIT: I had installed Internet Explorer 7, so i decided to install Internet explorer 8. Nothing changed. I can click that button as long as i want, ONLY IN MY COMPUTER that page is stuck and doesn't load.... :(:D:)

EDIT AGAIN :x

By disconnecting from this windows account and logging into a new one i got the script working. Obviously my main windows computer account is fu**ed up... Heavy use of it must have ruined something.... D'oh....

Edited by Newb

I'm a compulsive poster. When I post something, come to read it at least 5 minutes later after the posting, because I will edit it. I edited even this signature a few minutes later after I wrote it.

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...