Jump to content
Sign in to follow this  

_IECreateEmbedded ()

Recommended Posts

Hi people,

I am creating tool for a client that needs to login to a website and than submit data.

On my developer comp everything is ok - ie is embedded in to GUI but on clients comp it is opening browser (IE)

I did some reading ...(Ty DaleHohm and trancexx for some great solutions) but i am stuck here.No idea why it is not showing it embedded.

Please help

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_outfile=Sitename Tool.exe
#Obfuscator_Parameters=/cs 0 /cn 0 /cv 0 /sf 1 /sv 1
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

#include <GuiTreeView.au3>
#include <file.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
#include <Process.au3>
#include <GUIComboBox.au3>
#include <GUIListBox.au3>
#include <Array.au3>
#include <WinAPI.au3>
#include <Date.au3>
#include <GDIPlus.au3>
#include <ScreenCapture.au3>
#include <IE.au3>

Opt("TrayIconDebug", 1)
Opt("WinTitleMatchMode", 2)


Global $oIE
Global $embGUI

LoginToSIte(IniRead(@ScriptDir & "\Settings.ini", "login", "username", ""), IniRead(@ScriptDir & "\Settings.ini", "login", "password", ""))


Func LoginToSite($username, $password)
    ShowTip("In progress...", "Loging in to sitename", 1)
    WinActivate("Embedded Web control")
    $lladdress = "https://sitename.me/"
    _IENavigate ($oIE, $lladdress)
    _IELoadWait ($oIE)
    $o_form = _IEFormGetCollection ($oIE, 0)
    $o_email = _IEFormElementGetObjByName ($o_form, "ctl00$txtUsername")
    $o_password = _IEFormElementGetObjByName ($o_form, "ctl00$txtPassword")
    $o_passwordmask = _IEFormElementGetObjByName ($o_form, "ctl00$txtPassword2")
    $o_btnLogin = _IEFormElementGetObjByName ($o_form, "ctl00$btnLogin")
    _IEFormElementSetValue ($o_email, $username)
    _IEFormElementSetValue ($o_passwordmask, "XXXXXX")
    _IEFormElementSetValue ($o_password, $password)
    _IEFormImageClick ($oIE, "Login")
    ShowTip("Done !", "Loging in to sitename", 1)
EndFunc   ;==>L

Func CreateIEEmbeded()
_IEErrorHandlerRegister ()
$oIE = _IECreateEmbedded ()
$embgui = GUICreate("Embedded Web control", @DesktopWidth, @DesktopHeight,0,0 ,$WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)
$GUIActiveX = GUICtrlCreateObj($oIE, 10,10, @DesktopWidth -20, @DesktopHeight -20)

Share this post

Link to post
Share on other sites

No need to add _IELoadWait after _IENavigate ( func Wait for page load to complete before returning )

and It's embedded for me.

Is your client comp on IE9 ?

Edited by wakillon

AutoIt X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post

Link to post
Share on other sites

Me:Try this : Open IE press F-12 Find "Browser mode" ..Change it to IE8 just for testing

Client:Yes it is embedded now

_IENavigate ( ByRef $o_object, $s_url [, $f_wait = 1] )

Didnt notice,ty for pointing out :mellow:

Dear admins you can mark this as SOLVED

Edited by BiBiBi

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...