Sign in to follow this  
Followers 0
Siahtech

_IECreateEmbedded() Bug/Problem

10 posts in this topic

So my problem is when I run this code not compiled it Loads Rdio but after I compile the site fails to load.

I am on windows 7(x64) Ultimate IE11
I have tried many different options of embedding IE and they all have the same problem.

and what I really don't get is why is it using a different browser compiled?

Not Compiled => Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/7.0)
 Compiled     => Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/7.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center

Example Code:

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

$Site = 'http://www.rdio.com/'

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)

Global $g_idError_Message = GUICtrlCreateLabel("", 100, 500, 500, 30)
GUICtrlSetColor(-1, 0xff0000)

GUISetState(@SW_SHOW) ;Show GUI

_IENavigate($oIE, $Site)
_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, $Site)
            _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)
    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

Any help would be appreciated

Share this post


Link to post
Share on other sites



Don't know why it loads uncompiled but it's because of this line...

_IEAction($oIE, "stop")

The user agent is different because Embedded IE is IE 7, and the installed internet explorer has no bearing on embedded.


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Don't know why it loads uncompiled but it's because of this line...

_IEAction($oIE, "stop")

The user agent is different because Embedded IE is IE 7, and the installed internet explorer has no bearing on embedded.

So Autoit has its own IE? or is it IE has a Embedded funtion and its old?

Edited by Siahtech

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

is there anyway I could tell it to run through my current IE? but still be Embedded into my Gui?

I have put alot of work into looking for a fix before i posted here.

Edited by Siahtech

Share this post


Link to post
Share on other sites

No.

You can however pseudo embed internet explorer, you'll find a script for that in example forum.

Thanks I will look into it!

Share this post


Link to post
Share on other sites

Pointer to the "pseudo" in my sig...

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

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

also I found THis

'?do=embed' frameborder='0' data-embedContent>>

it Fixed my Problem It now uses IE11 =P

This is what I used to fix my issue

#include<Process.au3>
$sVersion = StringSplit(FileGetVersion(@ProgramFilesDir & "\Internet Explorer\iexplore.exe"), '.')
If StringInStr(@ProgramFilesDir, '(x86)') Then $64 = 'x64"'
If $64 = 'x64' Then
    RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION", _ProcessGetName(@AutoItPID), "REG_DWORD", SelectVersion($sVersion[1]))
Else
    RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION", _ProcessGetName(@AutoItPID), "REG_DWORD", SelectVersion($sVersion[1]))
EndIf

Func SelectVersion($Version)
    If $Version = 11 Then $Version = '0x2AF9'
    If $Version = 10 Then $Version = '0x2711'
    If $Version = 9 Then $Version = '0x270F'
    If $Version = 8 Then $Version = '0x22B8'
    Return $Version
EndFunc   ;==>SelectVersion
Edited by Siahtech

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0