Jump to content

Windows 11 and the IE udf


Recommended Posts

Hello all.  I, like many of you more likely than not, recently upgraded (if you can call it that 😦) to the windows 11 operating system.  Unfortunately, it seems that microsft is offically discontinuing Internet Explorer in windows 11, and since AutoIT's capability to automate the internet uses Internet explorer com objects, I was wondering if there was any official replacement for the IE udf in the works.  And if not, then I wanted to discuss other technologies/methods which could be implemented in autoit that would restore the lost capabilities.  Thanks.

https://www.theverge.com/2021/6/25/22550714/microsoft-windows-11-internet-explorer-disabled

Link to comment
Share on other sites

have you already tried this post? (www.autoitscript.com/forum/topic/204362-microsoft-edge-webview2-embed-web-code-in-your-native-application/) it cannot be considered a replacement for IE, but it could come close;

and of course the WebDriver? (www.autoitscript.com/forum/topic/191990-webdriver-udf-w3c-compliant-version-08312021/)


P.S.

I'm curious to know if the "BrowserControl" remains active on WIN11 (I think I hope so), could you please try to run this script (www.autoitscript.com/forum/topic/186422-who-is-who-a-little-dragdrop-game/) or this other (www.autoitscript.com/forum/topic/206853-aquarium/) on win11 and see if they work?

Thanks a lot in advance

Edited by Chimp

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Link to comment
Share on other sites

 

Windows 11 Pro 21H2 22000.282 - 
This help example don't work for me:

; Create browser windows with each of the example pages displayed.
; The object variable returned can be used just as the object
; variables returned by _IECreate or _IEAttach

#include <IE.au3>

Local $oIE_basic = _IE_Example("basic")
Local $oIE_form = _IE_Example("form")
Local $oIE_table = _IE_Example("table")
Local $oIE_frameset = _IE_Example("frameset")
Local $oIE_iframe = _IE_Example("iframe")

Error message:

"C:\Program Files (x86)\AutoIt3\Include\IE.au3" (1943) : ==> The requested action with this object has failed.:
$oObject.Focus()
$oObject^ ERROR
>Exit code: 1    Time: 0.5855

 

Link to comment
Share on other sites

You would have to use _IECreateEmbedded basic example using the _IE_Example and _IECreateEmbedded from the help file.

; 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 <IE.au3>
#include <WindowsConstants.au3>

Local $oIE = _IECreateEmbedded()
GUICreate("Embedded Web control Test", 640, 580, _
        (@DesktopWidth - 640) / 2, (@DesktopHeight - 580) / 2, _
        $WS_OVERLAPPEDWINDOW + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN)
GUICtrlCreateObj($oIE, 10, 40, 600, 360)
Local $idButton_Back = GUICtrlCreateButton("Back", 10, 420, 100, 30)
Local $idButton_Forward = GUICtrlCreateButton("Forward", 120, 420, 100, 30)
Local $idButton_Home = GUICtrlCreateButton("Home", 230, 420, 100, 30)
Local $idButton_Stop = GUICtrlCreateButton("Stop", 340, 420, 100, 30)
GUICtrlCreateLabel("Examples", 10, 462, 100, 21)
Local $idExamples = GUICtrlCreateCombo("", 110, 460, 300, 25)
    GUICtrlSetData($idExamples, "basic|form|table|frameset|iframe", "basic")
Global $g_idError_Message = GUICtrlCreateLabel("", 100, 500, 500, 30)
GUICtrlSetColor(-1, 0xff0000)

GUISetState(@SW_SHOW) ;Show GUI

__IE_Example(GUICtrlRead($idExamples))
_IEAction($oIE, "stop")

; Waiting for user to close the window
While 1
    Local $iMsg = GUIGetMsg()
    Select
        Case $iMsg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $iMsg = $idButton_Home
            _IENavigate($oIE, "http://www.autoitscript.com")
            _IEAction($oIE, "stop")
            _IEAction($oIE, "back")
            CheckError("Home", @error, @extended)
        Case $iMsg = $idButton_Back
            _IEAction($oIE, "back")
            CheckError("Back", @error, @extended)
        Case $iMsg = $idButton_Forward
            _IEAction($oIE, "forward")
            CheckError("Forward", @error, @extended)
        Case $iMsg = $idButton_Stop
            _IEAction($oIE, "stop")
            CheckError("Stop", @error, @extended)
        Case $iMsg = $idExamples
            __IE_Example(GUICtrlRead($idExamples))
    EndSelect
WEnd

GUIDelete()

Exit

Func CheckError($sMsg, $iError, $iExtended)
    If $iError Then
        $sMsg = "Error using " & $sMsg & " button (" & $iExtended & ")"
    Else
        $sMsg = ""
    EndIf
    GUICtrlSetData($g_idError_Message, $sMsg)
EndFunc   ;==>CheckError

Func __IE_Example($sModule = "basic")
    Local $sHTML = ""
    Switch $sModule
        Case "basic"
            $sHTML &= '<!DOCTYPE html>' & @CR
            $sHTML &= '<html>' & @CR
            $sHTML &= '<head>' & @CR
            $sHTML &= '<meta content="text/html; charset=UTF-8" http-equiv="content-type">' & @CR
            $sHTML &= '<title>_IE_Example("basic")</title>' & @CR
            $sHTML &= '<style>body {font-family: Arial}</style>' & @CR
            $sHTML &= '</head>' & @CR
            $sHTML &= '<body>' & @CR
            $sHTML &= '<a href="http://www.autoitscript.com"><img src="http://www.autoitscript.com/images/logo_autoit_210x72.png" id="AutoItImage" alt="AutoIt Homepage Image" style="background: #204080;"></a>' & @CR
            $sHTML &= '<p></p>' & @CR
            $sHTML &= '<div id="line1">This is a simple HTML page with text, links and images.</div>' & @CR
            $sHTML &= '<br>' & @CR
            $sHTML &= '<div id="line2"><a href="http://www.autoitscript.com">AutoIt</a> is a wonderful automation scripting language.</div>' & @CR
            $sHTML &= '<br>' & @CR
            $sHTML &= '<div id="line3">It is supported by a very active and supporting <a href="http://www.autoitscript.com/forum/">user forum</a>.</div>' & @CR
            $sHTML &= '<br>' & @CR
            $sHTML &= '<div id="IEAu3Data"></div>' & @CR
            $sHTML &= '</body>' & @CR
            $sHTML &= '</html>'
            _IENavigate($oIE, "about:blank")
            _IEDocWriteHTML($oIE, $sHTML)
        Case "table"
            $sHTML &= '<!DOCTYPE html>' & @CR
            $sHTML &= '<html>' & @CR
            $sHTML &= '<head>' & @CR
            $sHTML &= '<meta content="text/html; charset=utf-8" http-equiv="content-type">' & @CR
            $sHTML &= '<title>_IE_Example("table")</title>' & @CR
            $sHTML &= '<style>body {font-family: Arial}</style>' & @CR
            $sHTML &= '</head>' & @CR
            $sHTML &= '<body>' & @CR
            $sHTML &= '$oTableOne = _IETableGetObjByName($oIE, "tableOne")<br>' & @CR
            $sHTML &= '&lt;table border=1 id="tableOne"&gt;<br>' & @CR
            $sHTML &= '<table border=1 id="tableOne">' & @CR
            $sHTML &= ' <tr>' & @CR
            $sHTML &= '     <td>AutoIt</td>' & @CR
            $sHTML &= '     <td>is</td>' & @CR
            $sHTML &= '     <td>really</td>' & @CR
            $sHTML &= '     <td>great</td>' & @CR
            $sHTML &= '     <td>with</td>' & @CR
            $sHTML &= '     <td>IE.au3</td>' & @CR
            $sHTML &= ' </tr>' & @CR
            $sHTML &= ' <tr>' & @CR
            $sHTML &= '     <td>1</td>' & @CR
            $sHTML &= '     <td>2</td>' & @CR
            $sHTML &= '     <td>3</td>' & @CR
            $sHTML &= '     <td>4</td>' & @CR
            $sHTML &= '     <td>5</td>' & @CR
            $sHTML &= '     <td>6</td>' & @CR
            $sHTML &= ' </tr>' & @CR
            $sHTML &= ' <tr>' & @CR
            $sHTML &= '     <td>the</td>' & @CR
            $sHTML &= '     <td>quick</td>' & @CR
            $sHTML &= '     <td>red</td>' & @CR
            $sHTML &= '     <td>fox</td>' & @CR
            $sHTML &= '     <td>jumped</td>' & @CR
            $sHTML &= '     <td>over</td>' & @CR
            $sHTML &= ' </tr>' & @CR
            $sHTML &= ' <tr>' & @CR
            $sHTML &= '     <td>the</td>' & @CR
            $sHTML &= '     <td>lazy</td>' & @CR
            $sHTML &= '     <td>brown</td>' & @CR
            $sHTML &= '     <td>dog</td>' & @CR
            $sHTML &= '     <td>the</td>' & @CR
            $sHTML &= '     <td>time</td>' & @CR
            $sHTML &= ' </tr>' & @CR
            $sHTML &= ' <tr>' & @CR
            $sHTML &= '     <td>has</td>' & @CR
            $sHTML &= '     <td>come</td>' & @CR
            $sHTML &= '     <td>for</td>' & @CR
            $sHTML &= '     <td>all</td>' & @CR
            $sHTML &= '     <td>good</td>' & @CR
            $sHTML &= '     <td>men</td>' & @CR
            $sHTML &= ' </tr>' & @CR
            $sHTML &= ' <tr>' & @CR
            $sHTML &= '     <td>to</td>' & @CR
            $sHTML &= '     <td>come</td>' & @CR
            $sHTML &= '     <td>to</td>' & @CR
            $sHTML &= '     <td>the</td>' & @CR
            $sHTML &= '     <td>aid</td>' & @CR
            $sHTML &= '     <td>of</td>' & @CR
            $sHTML &= ' </tr>' & @CR
            $sHTML &= '</table>' & @CR
            $sHTML &= '<br>' & @CR
            $sHTML &= '$oTableTwo = _IETableGetObjByName($oIE, "tableTwo")<br>' & @CR
            $sHTML &= '&lt;table border="1" id="tableTwo"&gt;<br>' & @CR
            $sHTML &= '<table border=1 id="tableTwo">' & @CR
            $sHTML &= ' <tr>' & @CR
            $sHTML &= '     <td colspan="4">Table Top</td>' & @CR
            $sHTML &= ' </tr>' & @CR
            $sHTML &= ' <tr>' & @CR
            $sHTML &= '     <td>One</td>' & @CR
            $sHTML &= '     <td colspan="3">Two</td>' & @CR
            $sHTML &= ' </tr>' & @CR
            $sHTML &= ' <tr>' & @CR
            $sHTML &= '     <td>Three</td>' & @CR
            $sHTML &= '     <td>Four</td>' & @CR
            $sHTML &= '     <td colspan="2">Five</td>' & @CR
            $sHTML &= ' </tr>' & @CR
            $sHTML &= ' <tr>' & @CR
            $sHTML &= '     <td>Six</td>' & @CR
            $sHTML &= '     <td colspan="3">Seven</td>' & @CR
            $sHTML &= ' </tr>' & @CR
            $sHTML &= ' <tr>' & @CR
            $sHTML &= '     <td>Eight</td>' & @CR
            $sHTML &= '     <td>Nine</td>' & @CR
            $sHTML &= '     <td>Ten</td>' & @CR
            $sHTML &= '     <td>Eleven</td>' & @CR
            $sHTML &= ' </tr>' & @CR
            $sHTML &= '</table>' & @CR
            $sHTML &= '</body>' & @CR
            $sHTML &= '</html>'
            _IENavigate($oIE, "about:blank")
            _IEDocWriteHTML($oIE, $sHTML)
        Case "form"
            $sHTML &= '<!DOCTYPE html>' & @CR
            $sHTML &= '<html>' & @CR
            $sHTML &= '<head>' & @CR
            $sHTML &= '<meta content="text/html; charset=UTF-8" http-equiv="content-type">' & @CR
            $sHTML &= '<title>_IE_Example("form")</title>' & @CR
            $sHTML &= '<style>body {font-family: Arial}' & @CR
            $sHTML &= 'td {padding:6px}</style>' & @CR
            $sHTML &= '</head>' & @CR
            $sHTML &= '<body>' & @CR
            $sHTML &= '<form name="ExampleForm" onSubmit="javascript:alert(''ExampleFormSubmitted'');" method="post">' & @CR
            $sHTML &= '<table style="border-spacing:6px 6px;" border=1>' & @CR
            $sHTML &= '<tr>' & @CR
            $sHTML &= '<td>ExampleForm</td>' & @CR
            $sHTML &= '<td>&lt;form name="ExampleForm" onSubmit="javascript:alert(''ExampleFormSubmitted'');" method="post"&gt;</td>' & @CR
            $sHTML &= '</tr>' & @CR
            $sHTML &= '<tr>' & @CR
            $sHTML &= '<td>Hidden Input Element<input type="hidden" name="hiddenExample" value="secret value"></td>' & @CR
            $sHTML &= '<td>&lt;input type="hidden" name="hiddenExample" value="secret value"&gt;</td>' & @CR
            $sHTML &= '</tr>' & @CR
            $sHTML &= '<tr>' & @CR
            $sHTML &= '<td>' & @CR
            $sHTML &= '<input type="text" name="textExample" value="http://" size="20" maxlength="30">' & @CR
            $sHTML &= '</td>' & @CR
            $sHTML &= '<td>&lt;input type="text" name="textExample" value="http://" size="20" maxlength="30"&gt;</td>' & @CR
            $sHTML &= '</tr>' & @CR
            $sHTML &= '<tr>' & @CR
            $sHTML &= '<td>' & @CR
            $sHTML &= '<input type="password" name="passwordExample" size="10">' & @CR
            $sHTML &= '</td>' & @CR
            $sHTML &= '<td>&lt;input type="password" name="passwordExample" size="10"&gt;</td>' & @CR
            $sHTML &= '</tr>' & @CR
            $sHTML &= '<tr>' & @CR
            $sHTML &= '<td>' & @CR
            $sHTML &= '<input type="file" name="fileExample">' & @CR
            $sHTML &= '</td>' & @CR
            $sHTML &= '<td>&lt;input type="file" name="fileExample"&gt;</td>' & @CR
            $sHTML &= '</tr>' & @CR
            $sHTML &= '<tr>' & @CR
            $sHTML &= '<td>' & @CR
            $sHTML &= '<input type="image" name="imageExample" alt="AutoIt Homepage" src="http://www.autoitscript.com/images/logo_autoit_210x72.png" style="background: #204080;>' & @CR
            $sHTML &= '</td>' & @CR
            $sHTML &= '<td>&lt;input type="image" name="imageExample" alt="AutoIt Homepage" src="http://www.autoitscript.com/images/logo_autoit_210x72.png"&gt;</td>' & @CR
            $sHTML &= '</tr>' & @CR
            $sHTML &= '<tr>' & @CR
            $sHTML &= '<td>' & @CR
            $sHTML &= '<textarea name="textareaExample" rows="5" cols="15">Hello!</textarea>' & @CR
            $sHTML &= '</td>' & @CR
            $sHTML &= '<td>&lt;textarea name="textareaExample" rows="5" cols="15"&gt;Hello!&lt;/textarea&gt;</td>' & @CR
            $sHTML &= '</tr>' & @CR
            $sHTML &= '<tr>' & @CR
            $sHTML &= '<td>' & @CR
            $sHTML &= '<input type="checkbox" name="checkboxG1Example" value="gameBasketball">Basketball<br>' & @CR
            $sHTML &= '<input type="checkbox" name="checkboxG1Example" value="gameFootball">Football<br>' & @CR
            $sHTML &= '<input type="checkbox" name="checkboxG2Example" value="gameTennis" checked>Tennis<br>' & @CR
            $sHTML &= '<input type="checkbox" name="checkboxG2Example" value="gameBaseball">Baseball' & @CR
            $sHTML &= '</td>' & @CR
            $sHTML &= '<td>&lt;input type="checkbox" name="checkboxG1Example" value="gameBasketball"&gt;Basketball&lt;br&gt;<br>' & @CR
            $sHTML &= '&lt;input type="checkbox" name="checkboxG1Example" value="gameFootball"&gt;Football&lt;br&gt;<br>' & @CR
            $sHTML &= '&lt;input type="checkbox" name="checkboxG2Example" value="gameTennis" checked&gt;Tennis&lt;br&gt;<br>' & @CR
            $sHTML &= '&lt;input type="checkbox" name="checkboxG2Example" value="gameBaseball"&gt;Baseball</td>' & @CR
            $sHTML &= '</tr>' & @CR
            $sHTML &= '<tr>' & @CR
            $sHTML &= '<td>' & @CR
            $sHTML &= '<input type="radio" name="radioExample" value="vehicleAirplane">Airplane<br>' & @CR
            $sHTML &= '<input type="radio" name="radioExample" value="vehicleTrain" checked>Train<br>' & @CR
            $sHTML &= '<input type="radio" name="radioExample" value="vehicleBoat">Boat<br>' & @CR
            $sHTML &= '<input type="radio" name="radioExample" value="vehicleCar">Car</td>' & @CR
            $sHTML &= '<td>&lt;input type="radio" name="radioExample" value="vehicleAirplane"&gt;Airplane&lt;br&gt;<br>' & @CR
            $sHTML &= '&lt;input type="radio" name="radioExample" value="vehicleTrain" checked&gt;Train&lt;br&gt;<br>' & @CR
            $sHTML &= '&lt;input type="radio" name="radioExample" value="vehicleBoat"&gt;Boat&lt;br&gt;<br>' & @CR
            $sHTML &= '&lt;input type="radio" name="radioExample" value="vehicleCar"&gt;Car&lt;br&gt;</td>' & @CR
            $sHTML &= '</tr>' & @CR
            $sHTML &= '<tr>' & @CR
            $sHTML &= '<td>' & @CR
            $sHTML &= '<select name="selectExample">' & @CR
            $sHTML &= '<option value="homepage.html">Homepage' & @CR
            $sHTML &= '<option value="midipage.html">Midipage' & @CR
            $sHTML &= '<option value="freepage.html">Freepage' & @CR
            $sHTML &= '</select>' & @CR
            $sHTML &= '</td>' & @CR
            $sHTML &= '<td>&lt;select name="selectExample"&gt;<br>' & @CR
            $sHTML &= '&lt;option value="homepage.html"&gt;Homepage<br>' & @CR
            $sHTML &= '&lt;option value="midipage.html"&gt;Midipage<br>' & @CR
            $sHTML &= '&lt;option value="freepage.html"&gt;Freepage<br>' & @CR
            $sHTML &= '&lt;/select&gt;</td>' & @CR
            $sHTML &= '</tr>' & @CR
            $sHTML &= '<tr>' & @CR
            $sHTML &= '<td>' & @CR
            $sHTML &= '<select name="multipleSelectExample" size="6" multiple>' & @CR
            $sHTML &= '<option value="Name1">Aaron' & @CR
            $sHTML &= '<option value="Name2">Bruce' & @CR
            $sHTML &= '<option value="Name3">Carlos' & @CR
            $sHTML &= '<option value="Name4">Denis' & @CR
            $sHTML &= '<option value="Name5">Ed' & @CR
            $sHTML &= '<option value="Name6">Freddy' & @CR
            $sHTML &= '</select>' & @CR
            $sHTML &= '</td>' & @CR
            $sHTML &= '<td>&lt;select name="multipleSelectExample" size="6" multiple&gt;<br>' & @CR
            $sHTML &= '&lt;option value="Name1"&gt;Aaron<br>' & @CR
            $sHTML &= '&lt;option value="Name2"&gt;Bruce<br>' & @CR
            $sHTML &= '&lt;option value="Name3"&gt;Carlos<br>' & @CR
            $sHTML &= '&lt;option value="Name4"&gt;Denis<br>' & @CR
            $sHTML &= '&lt;option value="Name5"&gt;Ed<br>' & @CR
            $sHTML &= '&lt;option value="Name6"&gt;Freddy<br>' & @CR
            $sHTML &= '&lt;/select&gt;</td>' & @CR
            $sHTML &= '</tr>' & @CR
            $sHTML &= '<tr>' & @CR
            $sHTML &= '<td>' & @CR
            $sHTML &= '<input name="submitExample" type="submit" value="Submit">' & @CR
            $sHTML &= '<input name="resetExample" type="reset" value="Reset">' & @CR
            $sHTML &= '</td>' & @CR
            $sHTML &= '<td>&lt;input name="submitExample" type="submit" value="Submit"&gt;<br>' & @CR
            $sHTML &= '&lt;input name="resetExample" type="reset" value="Reset"&gt;</td>' & @CR
            $sHTML &= '</tr>' & @CR
            $sHTML &= '</table>' & @CR
            $sHTML &= '<input type="hidden" name="hiddenExample" value="secret value">' & @CR
            $sHTML &= '</form>' & @CR
            $sHTML &= '</body>' & @CR
            $sHTML &= '</html>'
            _IENavigate($oIE, "about:blank")
            _IEDocWriteHTML($oIE, $sHTML)
        Case "frameset"
            $sHTML &= '<!DOCTYPE html>' & @CR
            $sHTML &= '<html>' & @CR
            $sHTML &= '<head>' & @CR
            $sHTML &= '<meta content="text/html; charset=UTF-8" http-equiv="content-type">' & @CR
            $sHTML &= '<title>_IE_Example("frameset")</title>' & @CR
            $sHTML &= '</head>' & @CR
            $sHTML &= '<frameset rows="25,200">' & @CR
            $sHTML &= ' <frame name=Top SRC=about:blank>' & @CR
            $sHTML &= ' <frameset cols="100,500">' & @CR
            $sHTML &= '     <frame name=Menu SRC=about:blank>' & @CR
            $sHTML &= '     <frame name=Main SRC=about:blank>' & @CR
            $sHTML &= ' </frameset>' & @CR
            $sHTML &= '</frameset>' & @CR
            $sHTML &= '</html>'
            _IENavigate($oIE, "about:blank")
            _IENavigate($oIE, "about:blank")
            _IEDocWriteHTML($oIE, $sHTML)
            _IEAction($oIE, "refresh")
            Local $oFrameTop = _IEFrameGetObjByName($oIE, "Top")
            Local $oFrameMenu = _IEFrameGetObjByName($oIE, "Menu")
            Local $oFrameMain = _IEFrameGetObjByName($oIE, "Main")
            _IEBodyWriteHTML($oFrameTop, '$oFrameTop = _IEFrameGetObjByName($oIE, "Top")')
            _IEBodyWriteHTML($oFrameMenu, '$oFrameMenu = _IEFrameGetObjByName($oIE, "Menu")')
            _IEBodyWriteHTML($oFrameMain, '$oFrameMain = _IEFrameGetObjByName($oIE, "Main")')
        Case "iframe"
            $sHTML &= '<!DOCTYPE html>' & @CR
            $sHTML &= '<html>' & @CR
            $sHTML &= '<head>' & @CR
            $sHTML &= '<meta content="text/html; charset=UTF-8" http-equiv="content-type">' & @CR
            $sHTML &= '<title>_IE_Example("iframe")</title>' & @CR
            $sHTML &= '<style>td {padding:6px}</style>' & @CR
            $sHTML &= '</head>' & @CR
            $sHTML &= '<body>' & @CR
            $sHTML &= '<table style="border-spacing:6px" border=1>' & @CR
            $sHTML &= '<tr>' & @CR
            $sHTML &= '<td><iframe name="iFrameOne" src="about:blank" title="iFrameOne"></iframe></td>' & @CR
            $sHTML &= '<td>&lt;iframe name="iFrameOne" src="about:blank" title="iFrameOne"&gt;</td>' & @CR
            $sHTML &= '</tr>' & @CR
            $sHTML &= '<tr>' & @CR
            $sHTML &= '<td><iframe name="iFrameTwo" src="about:blank" title="iFrameTwo"></iframe></td>' & @CR
            $sHTML &= '<td>&lt;iframe name="iFrameTwo" src="about:blank" title="iFrameTwo"&gt;</td>' & @CR
            $sHTML &= '</tr>' & @CR
            $sHTML &= '</table>' & @CR
            $sHTML &= '</body>' & @CR
            $sHTML &= '</html>'
            _IENavigate($oIE, "about:blank")
            _IEDocWriteHTML($oIE, $sHTML)
            _IEAction($oIE, "refresh")
            Local $oIFrameOne = _IEFrameGetObjByName($oIE, "iFrameOne")
            Local $oIFrameTwo = _IEFrameGetObjByName($oIE, "iFrameTwo")
            _IEBodyWriteHTML($oIFrameOne, '$oIFrameOne = _IEFrameGetObjByName($oIE, "iFrameOne")')
            _IEBodyWriteHTML($oIFrameTwo, '$oIFrameTwo = _IEFrameGetObjByName($oIE, "iFrameTwo")')
        Case Else
            __IEConsoleWriteError("Error", "_IE_Example", "$_IESTATUS_InvalidValue")
            Return SetError($_IESTATUS_InvalidValue, 1, 0)
    EndSwitch

    ;   at least under IE10 some delay is needed to have functions as _IEPropertySet() working
    ;   value can depend of processor speed ...
    Sleep(500)
    Return SetError($_IESTATUS_Success, 0, $oIE)
EndFunc   ;==>_IE_Example

 

Link to comment
Share on other sites

  • 4 months later...

Little refactored version:

; 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 <IE.au3>
#include <WindowsConstants.au3>


Global $oIE
Global $g_idError_Message

_IEErrorHandlerRegister()

_Example()
Exit

Func _Example()
    $oIE = _IECreateEmbedded()
    GUICreate("Embedded Web control Test", 640, 580, _
            (@DesktopWidth - 640) / 2, (@DesktopHeight - 580) / 2, _
            $WS_OVERLAPPEDWINDOW + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN)
    Local $iEmbededIE = GUICtrlCreateObj($oIE, 5, 5, 640-10, 360)
    GUICtrlSetResizing($iEmbededIE, $GUI_DOCKAUTO)

    Local $idButton_Back = GUICtrlCreateButton("Back", 10, 420, 100, 30)
    Local $idButton_Forward = GUICtrlCreateButton("Forward", 120, 420, 100, 30)
    Local $idButton_Home = GUICtrlCreateButton("Home", 230, 420, 100, 30)
    Local $idButton_Stop = GUICtrlCreateButton("Stop", 340, 420, 100, 30)
    GUICtrlCreateLabel("Examples", 10, 462, 100, 21)
    Local $idExamples = GUICtrlCreateCombo("", 110, 460, 300, 25)
    GUICtrlSetData($idExamples, "basic|form|table|frameset|iframe", "basic")
    $g_idError_Message = GUICtrlCreateLabel("", 100, 500, 500, 30)
    GUICtrlSetColor(-1, 0xff0000)

    GUISetState(@SW_SHOW) ;Show GUI

    __IE_Example(GUICtrlRead($idExamples))
    _IEAction($oIE, "stop")

    ; Waiting for user to close the window
    While 1
        Local $iMsg = GUIGetMsg()
        Select
            Case $iMsg = $GUI_EVENT_CLOSE
                ExitLoop
            Case $iMsg = $idButton_Home
                _IENavigate($oIE, "http://www.autoitscript.com")
                _IEAction($oIE, "stop")
                _IEAction($oIE, "back")
                CheckError("Home", @error, @extended)
            Case $iMsg = $idButton_Back
                _IEAction($oIE, "back")
                CheckError("Back", @error, @extended)
            Case $iMsg = $idButton_Forward
                _IEAction($oIE, "forward")
                CheckError("Forward", @error, @extended)
            Case $iMsg = $idButton_Stop
                _IEAction($oIE, "stop")
                CheckError("Stop", @error, @extended)
            Case $iMsg = $idExamples
                __IE_Example(GUICtrlRead($idExamples))
        EndSelect
    WEnd

    GUIDelete()

EndFunc   ;==>_Example


Func CheckError($sMsg, $iError, $iExtended)
    If $iError Then
        $sMsg = "Error using " & $sMsg & " button (" & $iExtended & ")"
    Else
        $sMsg = ""
    EndIf
    GUICtrlSetData($g_idError_Message, $sMsg)
EndFunc   ;==>CheckError

Func __IE_Example($sModule = "basic")
    Local $sHTML = ""
    Switch $sModule
        Case "basic"
            $sHTML &= '<!DOCTYPE html>' & @CR
            $sHTML &= '<html>' & @CR
            $sHTML &= '<head>' & @CR
            $sHTML &= '<meta content="text/html; charset=UTF-8" http-equiv="content-type">' & @CR
            $sHTML &= '<title>_IE_Example("basic")</title>' & @CR
            $sHTML &= '<style>body {font-family: Arial}</style>' & @CR
            $sHTML &= '</head>' & @CR
            $sHTML &= '<body>' & @CR
            $sHTML &= '<a href="http://www.autoitscript.com"><img src="http://www.autoitscript.com/images/logo_autoit_210x72.png" id="AutoItImage" alt="AutoIt Homepage Image" style="background: #204080;"></a>' & @CR
            $sHTML &= '<p></p>' & @CR
            $sHTML &= '<div id="line1">This is a simple HTML page with text, links and images.</div>' & @CR
            $sHTML &= '<br>' & @CR
            $sHTML &= '<div id="line2"><a href="http://www.autoitscript.com">AutoIt</a> is a wonderful automation scripting language.</div>' & @CR
            $sHTML &= '<br>' & @CR
            $sHTML &= '<div id="line3">It is supported by a very active and supporting <a href="http://www.autoitscript.com/forum/">user forum</a>.</div>' & @CR
            $sHTML &= '<br>' & @CR
            $sHTML &= '<div id="IEAu3Data"></div>' & @CR
            $sHTML &= '</body>' & @CR
            $sHTML &= '</html>'
            _IENavigate($oIE, "about:blank")
            _IEDocWriteHTML($oIE, $sHTML)
        Case "table"
            $sHTML &= '<!DOCTYPE html>' & @CR
            $sHTML &= '<html>' & @CR
            $sHTML &= '<head>' & @CR
            $sHTML &= '<meta content="text/html; charset=utf-8" http-equiv="content-type">' & @CR
            $sHTML &= '<title>_IE_Example("table")</title>' & @CR
            $sHTML &= '<style>body {font-family: Arial}</style>' & @CR
            $sHTML &= '</head>' & @CR
            $sHTML &= '<body>' & @CR
            $sHTML &= '$oTableOne = _IETableGetObjByName($oIE, "tableOne")<br>' & @CR
            $sHTML &= '&lt;table border=1 id="tableOne"&gt;<br>' & @CR
            $sHTML &= '<table border=1 id="tableOne">' & @CR
            $sHTML &= ' <tr>' & @CR
            $sHTML &= '     <td>AutoIt</td>' & @CR
            $sHTML &= '     <td>is</td>' & @CR
            $sHTML &= '     <td>really</td>' & @CR
            $sHTML &= '     <td>great</td>' & @CR
            $sHTML &= '     <td>with</td>' & @CR
            $sHTML &= '     <td>IE.au3</td>' & @CR
            $sHTML &= ' </tr>' & @CR
            $sHTML &= ' <tr>' & @CR
            $sHTML &= '     <td>1</td>' & @CR
            $sHTML &= '     <td>2</td>' & @CR
            $sHTML &= '     <td>3</td>' & @CR
            $sHTML &= '     <td>4</td>' & @CR
            $sHTML &= '     <td>5</td>' & @CR
            $sHTML &= '     <td>6</td>' & @CR
            $sHTML &= ' </tr>' & @CR
            $sHTML &= ' <tr>' & @CR
            $sHTML &= '     <td>the</td>' & @CR
            $sHTML &= '     <td>quick</td>' & @CR
            $sHTML &= '     <td>red</td>' & @CR
            $sHTML &= '     <td>fox</td>' & @CR
            $sHTML &= '     <td>jumped</td>' & @CR
            $sHTML &= '     <td>over</td>' & @CR
            $sHTML &= ' </tr>' & @CR
            $sHTML &= ' <tr>' & @CR
            $sHTML &= '     <td>the</td>' & @CR
            $sHTML &= '     <td>lazy</td>' & @CR
            $sHTML &= '     <td>brown</td>' & @CR
            $sHTML &= '     <td>dog</td>' & @CR
            $sHTML &= '     <td>the</td>' & @CR
            $sHTML &= '     <td>time</td>' & @CR
            $sHTML &= ' </tr>' & @CR
            $sHTML &= ' <tr>' & @CR
            $sHTML &= '     <td>has</td>' & @CR
            $sHTML &= '     <td>come</td>' & @CR
            $sHTML &= '     <td>for</td>' & @CR
            $sHTML &= '     <td>all</td>' & @CR
            $sHTML &= '     <td>good</td>' & @CR
            $sHTML &= '     <td>men</td>' & @CR
            $sHTML &= ' </tr>' & @CR
            $sHTML &= ' <tr>' & @CR
            $sHTML &= '     <td>to</td>' & @CR
            $sHTML &= '     <td>come</td>' & @CR
            $sHTML &= '     <td>to</td>' & @CR
            $sHTML &= '     <td>the</td>' & @CR
            $sHTML &= '     <td>aid</td>' & @CR
            $sHTML &= '     <td>of</td>' & @CR
            $sHTML &= ' </tr>' & @CR
            $sHTML &= '</table>' & @CR
            $sHTML &= '<br>' & @CR
            $sHTML &= '$oTableTwo = _IETableGetObjByName($oIE, "tableTwo")<br>' & @CR
            $sHTML &= '&lt;table border="1" id="tableTwo"&gt;<br>' & @CR
            $sHTML &= '<table border=1 id="tableTwo">' & @CR
            $sHTML &= ' <tr>' & @CR
            $sHTML &= '     <td colspan="4">Table Top</td>' & @CR
            $sHTML &= ' </tr>' & @CR
            $sHTML &= ' <tr>' & @CR
            $sHTML &= '     <td>One</td>' & @CR
            $sHTML &= '     <td colspan="3">Two</td>' & @CR
            $sHTML &= ' </tr>' & @CR
            $sHTML &= ' <tr>' & @CR
            $sHTML &= '     <td>Three</td>' & @CR
            $sHTML &= '     <td>Four</td>' & @CR
            $sHTML &= '     <td colspan="2">Five</td>' & @CR
            $sHTML &= ' </tr>' & @CR
            $sHTML &= ' <tr>' & @CR
            $sHTML &= '     <td>Six</td>' & @CR
            $sHTML &= '     <td colspan="3">Seven</td>' & @CR
            $sHTML &= ' </tr>' & @CR
            $sHTML &= ' <tr>' & @CR
            $sHTML &= '     <td>Eight</td>' & @CR
            $sHTML &= '     <td>Nine</td>' & @CR
            $sHTML &= '     <td>Ten</td>' & @CR
            $sHTML &= '     <td>Eleven</td>' & @CR
            $sHTML &= ' </tr>' & @CR
            $sHTML &= '</table>' & @CR
            $sHTML &= '</body>' & @CR
            $sHTML &= '</html>'
            _IENavigate($oIE, "about:blank")
            _IEDocWriteHTML($oIE, $sHTML)
        Case "form"
            $sHTML &= '<!DOCTYPE html>' & @CR
            $sHTML &= '<html>' & @CR
            $sHTML &= '<head>' & @CR
            $sHTML &= '<meta content="text/html; charset=UTF-8" http-equiv="content-type">' & @CR
            $sHTML &= '<title>_IE_Example("form")</title>' & @CR
            $sHTML &= '<style>body {font-family: Arial}' & @CR
            $sHTML &= 'td {padding:6px}</style>' & @CR
            $sHTML &= '</head>' & @CR
            $sHTML &= '<body>' & @CR
            $sHTML &= '<form name="ExampleForm" onSubmit="javascript:alert(''ExampleFormSubmitted'');" method="post">' & @CR
            $sHTML &= '<table style="border-spacing:6px 6px;" border=1>' & @CR
            $sHTML &= '<tr>' & @CR
            $sHTML &= '<td>ExampleForm</td>' & @CR
            $sHTML &= '<td>&lt;form name="ExampleForm" onSubmit="javascript:alert(''ExampleFormSubmitted'');" method="post"&gt;</td>' & @CR
            $sHTML &= '</tr>' & @CR
            $sHTML &= '<tr>' & @CR
            $sHTML &= '<td>Hidden Input Element<input type="hidden" name="hiddenExample" value="secret value"></td>' & @CR
            $sHTML &= '<td>&lt;input type="hidden" name="hiddenExample" value="secret value"&gt;</td>' & @CR
            $sHTML &= '</tr>' & @CR
            $sHTML &= '<tr>' & @CR
            $sHTML &= '<td>' & @CR
            $sHTML &= '<input type="text" name="textExample" value="http://" size="20" maxlength="30">' & @CR
            $sHTML &= '</td>' & @CR
            $sHTML &= '<td>&lt;input type="text" name="textExample" value="http://" size="20" maxlength="30"&gt;</td>' & @CR
            $sHTML &= '</tr>' & @CR
            $sHTML &= '<tr>' & @CR
            $sHTML &= '<td>' & @CR
            $sHTML &= '<input type="password" name="passwordExample" size="10">' & @CR
            $sHTML &= '</td>' & @CR
            $sHTML &= '<td>&lt;input type="password" name="passwordExample" size="10"&gt;</td>' & @CR
            $sHTML &= '</tr>' & @CR
            $sHTML &= '<tr>' & @CR
            $sHTML &= '<td>' & @CR
            $sHTML &= '<input type="file" name="fileExample">' & @CR
            $sHTML &= '</td>' & @CR
            $sHTML &= '<td>&lt;input type="file" name="fileExample"&gt;</td>' & @CR
            $sHTML &= '</tr>' & @CR
            $sHTML &= '<tr>' & @CR
            $sHTML &= '<td>' & @CR
            $sHTML &= '<input type="image" name="imageExample" alt="AutoIt Homepage" src="http://www.autoitscript.com/images/logo_autoit_210x72.png" style="background: #204080;>' & @CR
            $sHTML &= '</td>' & @CR
            $sHTML &= '<td>&lt;input type="image" name="imageExample" alt="AutoIt Homepage" src="http://www.autoitscript.com/images/logo_autoit_210x72.png"&gt;</td>' & @CR
            $sHTML &= '</tr>' & @CR
            $sHTML &= '<tr>' & @CR
            $sHTML &= '<td>' & @CR
            $sHTML &= '<textarea name="textareaExample" rows="5" cols="15">Hello!</textarea>' & @CR
            $sHTML &= '</td>' & @CR
            $sHTML &= '<td>&lt;textarea name="textareaExample" rows="5" cols="15"&gt;Hello!&lt;/textarea&gt;</td>' & @CR
            $sHTML &= '</tr>' & @CR
            $sHTML &= '<tr>' & @CR
            $sHTML &= '<td>' & @CR
            $sHTML &= '<input type="checkbox" name="checkboxG1Example" value="gameBasketball">Basketball<br>' & @CR
            $sHTML &= '<input type="checkbox" name="checkboxG1Example" value="gameFootball">Football<br>' & @CR
            $sHTML &= '<input type="checkbox" name="checkboxG2Example" value="gameTennis" checked>Tennis<br>' & @CR
            $sHTML &= '<input type="checkbox" name="checkboxG2Example" value="gameBaseball">Baseball' & @CR
            $sHTML &= '</td>' & @CR
            $sHTML &= '<td>&lt;input type="checkbox" name="checkboxG1Example" value="gameBasketball"&gt;Basketball&lt;br&gt;<br>' & @CR
            $sHTML &= '&lt;input type="checkbox" name="checkboxG1Example" value="gameFootball"&gt;Football&lt;br&gt;<br>' & @CR
            $sHTML &= '&lt;input type="checkbox" name="checkboxG2Example" value="gameTennis" checked&gt;Tennis&lt;br&gt;<br>' & @CR
            $sHTML &= '&lt;input type="checkbox" name="checkboxG2Example" value="gameBaseball"&gt;Baseball</td>' & @CR
            $sHTML &= '</tr>' & @CR
            $sHTML &= '<tr>' & @CR
            $sHTML &= '<td>' & @CR
            $sHTML &= '<input type="radio" name="radioExample" value="vehicleAirplane">Airplane<br>' & @CR
            $sHTML &= '<input type="radio" name="radioExample" value="vehicleTrain" checked>Train<br>' & @CR
            $sHTML &= '<input type="radio" name="radioExample" value="vehicleBoat">Boat<br>' & @CR
            $sHTML &= '<input type="radio" name="radioExample" value="vehicleCar">Car</td>' & @CR
            $sHTML &= '<td>&lt;input type="radio" name="radioExample" value="vehicleAirplane"&gt;Airplane&lt;br&gt;<br>' & @CR
            $sHTML &= '&lt;input type="radio" name="radioExample" value="vehicleTrain" checked&gt;Train&lt;br&gt;<br>' & @CR
            $sHTML &= '&lt;input type="radio" name="radioExample" value="vehicleBoat"&gt;Boat&lt;br&gt;<br>' & @CR
            $sHTML &= '&lt;input type="radio" name="radioExample" value="vehicleCar"&gt;Car&lt;br&gt;</td>' & @CR
            $sHTML &= '</tr>' & @CR
            $sHTML &= '<tr>' & @CR
            $sHTML &= '<td>' & @CR
            $sHTML &= '<select name="selectExample">' & @CR
            $sHTML &= '<option value="homepage.html">Homepage' & @CR
            $sHTML &= '<option value="midipage.html">Midipage' & @CR
            $sHTML &= '<option value="freepage.html">Freepage' & @CR
            $sHTML &= '</select>' & @CR
            $sHTML &= '</td>' & @CR
            $sHTML &= '<td>&lt;select name="selectExample"&gt;<br>' & @CR
            $sHTML &= '&lt;option value="homepage.html"&gt;Homepage<br>' & @CR
            $sHTML &= '&lt;option value="midipage.html"&gt;Midipage<br>' & @CR
            $sHTML &= '&lt;option value="freepage.html"&gt;Freepage<br>' & @CR
            $sHTML &= '&lt;/select&gt;</td>' & @CR
            $sHTML &= '</tr>' & @CR
            $sHTML &= '<tr>' & @CR
            $sHTML &= '<td>' & @CR
            $sHTML &= '<select name="multipleSelectExample" size="6" multiple>' & @CR
            $sHTML &= '<option value="Name1">Aaron' & @CR
            $sHTML &= '<option value="Name2">Bruce' & @CR
            $sHTML &= '<option value="Name3">Carlos' & @CR
            $sHTML &= '<option value="Name4">Denis' & @CR
            $sHTML &= '<option value="Name5">Ed' & @CR
            $sHTML &= '<option value="Name6">Freddy' & @CR
            $sHTML &= '</select>' & @CR
            $sHTML &= '</td>' & @CR
            $sHTML &= '<td>&lt;select name="multipleSelectExample" size="6" multiple&gt;<br>' & @CR
            $sHTML &= '&lt;option value="Name1"&gt;Aaron<br>' & @CR
            $sHTML &= '&lt;option value="Name2"&gt;Bruce<br>' & @CR
            $sHTML &= '&lt;option value="Name3"&gt;Carlos<br>' & @CR
            $sHTML &= '&lt;option value="Name4"&gt;Denis<br>' & @CR
            $sHTML &= '&lt;option value="Name5"&gt;Ed<br>' & @CR
            $sHTML &= '&lt;option value="Name6"&gt;Freddy<br>' & @CR
            $sHTML &= '&lt;/select&gt;</td>' & @CR
            $sHTML &= '</tr>' & @CR
            $sHTML &= '<tr>' & @CR
            $sHTML &= '<td>' & @CR
            $sHTML &= '<input name="submitExample" type="submit" value="Submit">' & @CR
            $sHTML &= '<input name="resetExample" type="reset" value="Reset">' & @CR
            $sHTML &= '</td>' & @CR
            $sHTML &= '<td>&lt;input name="submitExample" type="submit" value="Submit"&gt;<br>' & @CR
            $sHTML &= '&lt;input name="resetExample" type="reset" value="Reset"&gt;</td>' & @CR
            $sHTML &= '</tr>' & @CR
            $sHTML &= '</table>' & @CR
            $sHTML &= '<input type="hidden" name="hiddenExample" value="secret value">' & @CR
            $sHTML &= '</form>' & @CR
            $sHTML &= '</body>' & @CR
            $sHTML &= '</html>'
            _IENavigate($oIE, "about:blank")
            _IEDocWriteHTML($oIE, $sHTML)
        Case "frameset"
            $sHTML &= '<!DOCTYPE html>' & @CR
            $sHTML &= '<html>' & @CR
            $sHTML &= '<head>' & @CR
            $sHTML &= '<meta content="text/html; charset=UTF-8" http-equiv="content-type">' & @CR
            $sHTML &= '<title>_IE_Example("frameset")</title>' & @CR
            $sHTML &= '</head>' & @CR
            $sHTML &= '<frameset rows="25,200">' & @CR
            $sHTML &= ' <frame name=Top SRC=about:blank>' & @CR
            $sHTML &= ' <frameset cols="100,500">' & @CR
            $sHTML &= '     <frame name=Menu SRC=about:blank>' & @CR
            $sHTML &= '     <frame name=Main SRC=about:blank>' & @CR
            $sHTML &= ' </frameset>' & @CR
            $sHTML &= '</frameset>' & @CR
            $sHTML &= '</html>'
            _IENavigate($oIE, "about:blank")
            _IENavigate($oIE, "about:blank")
            _IEDocWriteHTML($oIE, $sHTML)
            _IEAction($oIE, "refresh")
            Local $oFrameTop = _IEFrameGetObjByName($oIE, "Top")
            Local $oFrameMenu = _IEFrameGetObjByName($oIE, "Menu")
            Local $oFrameMain = _IEFrameGetObjByName($oIE, "Main")
            _IEBodyWriteHTML($oFrameTop, '$oFrameTop = _IEFrameGetObjByName($oIE, "Top")')
            _IEBodyWriteHTML($oFrameMenu, '$oFrameMenu = _IEFrameGetObjByName($oIE, "Menu")')
            _IEBodyWriteHTML($oFrameMain, '$oFrameMain = _IEFrameGetObjByName($oIE, "Main")')
        Case "iframe"
            $sHTML &= '<!DOCTYPE html>' & @CR
            $sHTML &= '<html>' & @CR
            $sHTML &= '<head>' & @CR
            $sHTML &= '<meta content="text/html; charset=UTF-8" http-equiv="content-type">' & @CR
            $sHTML &= '<title>_IE_Example("iframe")</title>' & @CR
            $sHTML &= '<style>td {padding:6px}</style>' & @CR
            $sHTML &= '</head>' & @CR
            $sHTML &= '<body>' & @CR
            $sHTML &= '<table style="border-spacing:6px" border=1>' & @CR
            $sHTML &= '<tr>' & @CR
            $sHTML &= '<td><iframe name="iFrameOne" src="about:blank" title="iFrameOne"></iframe></td>' & @CR
            $sHTML &= '<td>&lt;iframe name="iFrameOne" src="about:blank" title="iFrameOne"&gt;</td>' & @CR
            $sHTML &= '</tr>' & @CR
            $sHTML &= '<tr>' & @CR
            $sHTML &= '<td><iframe name="iFrameTwo" src="about:blank" title="iFrameTwo"></iframe></td>' & @CR
            $sHTML &= '<td>&lt;iframe name="iFrameTwo" src="about:blank" title="iFrameTwo"&gt;</td>' & @CR
            $sHTML &= '</tr>' & @CR
            $sHTML &= '</table>' & @CR
            $sHTML &= '</body>' & @CR
            $sHTML &= '</html>'
            _IENavigate($oIE, "about:blank")
            _IEDocWriteHTML($oIE, $sHTML)
            _IEAction($oIE, "refresh")
            Local $oIFrameOne = _IEFrameGetObjByName($oIE, "iFrameOne")
            Local $oIFrameTwo = _IEFrameGetObjByName($oIE, "iFrameTwo")
            _IEBodyWriteHTML($oIFrameOne, '$oIFrameOne = _IEFrameGetObjByName($oIE, "iFrameOne")')
            _IEBodyWriteHTML($oIFrameTwo, '$oIFrameTwo = _IEFrameGetObjByName($oIE, "iFrameTwo")')
        Case Else
            __IEConsoleWriteError("Error", "_IE_Example", "$_IESTATUS_InvalidValue")
            Return SetError($_IESTATUS_InvalidValue, 1, 0)
    EndSwitch

    ;   at least under IE10 some delay is needed to have functions as _IEPropertySet() working
    ;   value can depend of processor speed ...
    Sleep(500)
    Return SetError($_IESTATUS_Success, 0, $oIE)
EndFunc   ;==>__IE_Example

 

It is compiliant with Au3Check, and includes some GUI improvements (resizing).

Edited by mLipok
_IEErrorHandlerRegister()

Signature beginning:
* Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
* ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Code * for other useful stuff click the following button:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * 

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * 

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors  * HTML editor * 

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Link to comment
Share on other sites

btw.
Anybody intrested in using this way of accessing IE on Windows11 should also take a look on:

 

 

Signature beginning:
* Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
* ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Code * for other useful stuff click the following button:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * 

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * 

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors  * HTML editor * 

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Link to comment
Share on other sites

I wouldn’t use Internet explorer for anything that is the hugest security hole in the world. 
 

More and more organizations are going to be disabling Internet explorer all together so I wouldn’t count on this UDF it should be retired and go away forever. I wish they would stop shipping it and make it none available to everybody

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Link to comment
Share on other sites

22 hours ago, Earthshine said:

More and more organizations are going to be disabling Internet explorer all together so I wouldn’t count on this UDF it should be retired and go away forever. I wish they would stop shipping it and make it none available to everybody

Anyway, all Windows 10 users using a supported version (except the LTSC version) will be affected by the removal of Internet Explorer on June 15, 2022

https://docs.microsoft.com/en-us/lifecycle/announcements/internet-explorer-11-end-of-support

 

 

Link to comment
Share on other sites

IE will still be around until 2029, except you need to use IE mode within Edge, there are a number of legacy apps like SharePoint 2013 which are EOL next year, that still require activex components, in IE mode, Edge just embeds the window.  Several years ago I wrote an Outlook signature tool, which uses the IE UDF for previewing the users signature within a custom GUI prior to creating the signature, had hoped that the tool would die with Win11 so I no longer had to support it but unfortunately it is still used company wide with both Win10 and Win11 clients.

Link to comment
Share on other sites

On 10/23/2021 at 12:35 PM, Sergy said:

 

Windows 11 Pro 21H2 22000.282 - 
This help example don't work for me:

; Create browser windows with each of the example pages displayed.
; The object variable returned can be used just as the object
; variables returned by _IECreate or _IEAttach

#include <IE.au3>

Local $oIE_basic = _IE_Example("basic")
Local $oIE_form = _IE_Example("form")
Local $oIE_table = _IE_Example("table")
Local $oIE_frameset = _IE_Example("frameset")
Local $oIE_iframe = _IE_Example("iframe")

Error message:

"C:\Program Files (x86)\AutoIt3\Include\IE.au3" (1943) : ==> The requested action with this object has failed.:
$oObject.Focus()
$oObject^ ERROR
>Exit code: 1    Time: 0.5855

 

 

2022-03-12_205045.png

2022-03-12_205344.png

To community goes all my regards and thanks

Link to comment
Share on other sites

  • 3 weeks later...
On 3/8/2022 at 1:26 PM, jguinch said:

removal of Internet Explorer on June 15, 2022

from Windows 10 ?

I'm wondering why on Windows 11 it is still working ?

I mean I can use this script:
 

#include <IE.au3>

_Example()
Exit

Func _Example()
    Local $oIE = _IECreate()
    Sleep(2000)
    _IENavigate($oIE, 'www.google.com')
EndFunc   ;==>_Example


REMARK:
I have Windows 11 migrated from Windows 10.

REQUEST:
To anybody who have Windows 11 installed from scratch (not migrated from Windows 10):
Please try to use my script which I posted above.

Signature beginning:
* Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
* ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Code * for other useful stuff click the following button:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * 

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * 

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors  * HTML editor * 

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Link to comment
Share on other sites

36 minutes ago, mLipok said:

To anybody who have Windows 11 installed from scratch (not migrated from Windows 10):

image.thumb.png.4626218399fc3fe5e07c736040b3558f.png

..is not flawless. Clean install with ISO from MS. Note that no other browser is installed.
Side note: you should install some type of hypervisor to run other OSs in your PC. I find it helpful.

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Link to comment
Share on other sites

On 3/6/2022 at 7:31 PM, mLipok said:

It is compiliant with Au3Check, and includes some GUI improvements (resizing).

"C:\Utilities\autoit-v3.3.16\autoit-v3.3.16\Include\IE.au3" (659) : ==> The requested action with this object has failed.:
If String($oFrame.name) = $sName Then Return SetError($_IESTATUS_Success, 0, $oTemp.frames($sName))
If String($oFrame.name) = $sName Then Return SetError($_IESTATUS_Success, 0, $oTemp^ ERROR

 

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Link to comment
Share on other sites

18 minutes ago, argumentum said:

image.thumb.png.4626218399fc3fe5e07c736040b3558f.png

 

 

There is still a need to change settings:

 

image.png.bc9d5e4bb24c7f6431ec34326bbc7371.png

edge://settings/?search=explorer

 

Just try to set NEVER and DEFAULT

image.png.830890e75320a193bc56cd7c3affb025.png

Edited by mLipok

Signature beginning:
* Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
* ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Code * for other useful stuff click the following button:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * 

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * 

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors  * HTML editor * 

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Link to comment
Share on other sites

12 minutes ago, argumentum said:
"C:\Utilities\autoit-v3.3.16\autoit-v3.3.16\Include\IE.au3" (659) : ==> The requested action with this object has failed.:
If String($oFrame.name) = $sName Then Return SetError($_IESTATUS_Success, 0, $oTemp.frames($sName))
If String($oFrame.name) = $sName Then Return SetError($_IESTATUS_Success, 0, $oTemp^ ERROR

 

Hah...

 

so here is modified script:

#include <IE.au3>
_IEErrorHandlerRegister()

_Example()
Exit

Func _Example()
    Local $oIE = _IECreate()
    Sleep(2000)
    _IENavigate($oIE, 'www.google.com')
EndFunc   ;==>_Example

 

;)

 

Signature beginning:
* Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
* ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Code * for other useful stuff click the following button:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * 

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * 

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors  * HTML editor * 

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

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