Jump to content

New IECreatePseudoEmbedded() with few important improvements


Guest
 Share

Recommended Posts

Hello,

I created a function that create embedded IE frame in autoit GUI.
 

The benefits of this function over _IECreateEmbedded() in IE.au3 are very critical:

1) IECreatePseudoEmbedded() will create IE frame from the laset IE verison that installed on the computer.

_IECreateEmbedded() supports up to IE7.

The benefits of this function over the other functions from here:

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

1) the first benefit is that when my function start internet explorer for the frame, you will not see the IE window in full screen for about a second before the frame is created.

I upgraded the technique of the my predecessors. so now the frame is created in a more clean way.

2) I did Optimzation in some areas

3) The IE frame will create without having to finish to load the page and open internet explorer.

4) If error occurred, then you will see in the frame the reason of the error.

Thank you very much for slbmeh , DaleHohm , JohnOne .

With their example, I got inspired.

 

Example:

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GuiEdit.au3>

#include <WinAPIEx.au3>
#include <IE.au3>
#Include <Array.au3>

#AutoIt3Wrapper_Run_AU3Check=n

Example("http://www.autoitscript.com/site/")

Func Example($Url)
    Local $Form1 , $Button1 , $IE_Pid , $Close_Button , $IECreatePseudo , $oIE , $aMain , $nMsg

    #region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("", 705, 671)
    $Close_Button = GUICtrlCreateButton("Close", 600, 632, 89, 25)
    GUISetState(@SW_SHOW)
    $IECreatePseudo = IECreatePseudoEmbedded($Url, $Form1, 8, 16, 673, 609)
    If IsArray($IECreatePseudo) Then
        $oIE = $IECreatePseudo[0]
        $aMain = $IECreatePseudo[1]

        If IsObj($oIE) Then
            GUICtrlSetPos($oIE, 0, 0, 600, 632)
        EndIf
    EndIf

    #endregion ### END Koda GUI section ###
    WinSetOnTop($Form1, "", 1)
    ;Sleep(100)

    While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
            Case $GUI_EVENT_CLOSE , $Close_Button
                _IEQuit($oIE)
                ProcessWaitClose($aMain[0])
                ExitLoop
        EndSwitch
    WEnd
    GUIDelete($Form1)
EndFunc


; #FUNCTION# ====================================================================================================================
; Name ..........: IECreatePseudoEmbedded
; Description ...: Create IE frame in GUI with the laset IE verison that installed on the computer
; Syntax ........: IECreatePseudoEmbedded($sURL, $h_Parent, $i_Left, $i_Top, $i_Width, $i_Height[, $wait = 5000])
; Parameters ....: $sURL                - The URL to load.
;                  $h_Parent            - The handle of the GUI to create the IE frame in..
;                  $i_Left              - X pos.
;                  $i_Top               - Y Pos
;                  $i_Width             - The width of the frame.
;                  $i_Height            - The height of the frame.
;                  $wait                - [optional] max time to wait for the page to load. Default is 5000 ms.
; Return values .: If error:
;                   -1 = can't open internet explorer
;                   -2 = loading time limit reached
;                   -3 = object error occurred
;               .: Id not error:
;                   Array Variable:
;                       [0] = $o_object - Object variable of an InternetExplorer.Application, Window or Frame object
;                           the Object is for IE functions in IE.au3
;                       [1] = Another array:
;                               [0] = the pid of the IE frame
;                               [1] = the handle of the IE frame
; Author ........: gil900
; Modified ......: Yes and No ;)
; Inspired from .: http://www.autoitscript.com/forum/topic/152173-pseudo-embed-google-chrome/
;                  http://www.autoitscript.com/forum/topic/138980-iecreatepseudoembedded/
;                  http://www.autoitscript.com/forum/topic/99234-iecreate2/#entry712594
;                  AutoIt3\Include\IE.au3

; Remarks .......:
; Related .......:
; Link ..........:
; Example .......: yes

UDF:
IECreatePseudoEmbedded.au3

You need tp download the UDF and then copy the function IECreatePseudoEmbedded() into the example.

I hope you find it useful.

Please check the code and tell me if it works properly.
If there are bugs, please report to me. I wish you would fix problems by yourself (if you find any) and give me the patch here. I would love to have improvements.

When you report me, please include in your report the following:
* Your operating system, 64bit / 32 bit


Thank you

Gil

Edited by Guest
Link to comment
Share on other sites

  • 1 year later...

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