Jump to content
Sign in to follow this  
zackrspv

IECreate2

Recommended Posts

This is pretty good, one thing is that they create multiple instances of iexplore.exe

@ motionman95 you example creates 2 instances, and only closes 1, could still hear the youtube video going on after the gui was closed and 1 instance was closed.

Its ok to work around, but would be much better if it didnt happen

Other than that pretty nice.

Weird, I can't escape that problem. Any idea why it is happening?

EDIT:

_IEQuit($oIE) solves the problem.

Edited by motionman95

Share this post


Link to post
Share on other sites
I like this so much but unfortunately, this function doesn't support control resizing. When the user clicks the maximize button, size of the embedded IE remains unchanged :mellow: Can anybody fix this please? Edited by Bot

Share this post


Link to post
Share on other sites

I like this so much but unfortunately, this function doesn't support control resizing. When the user clicks the maximize button, size of the embedded IE remains unchanged :P Can anybody fix this please?

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_RESIZED, $GUI_EVENT_MAXIMIZE, $GUI_EVENT_RESTORE
            $newSize = WinGetClientSize($Form1)
            _WinAPI_MoveWindow($hHandle, 0, 0, $newSize[0], $newSize[1], True)
EndSwitch
WEnd

Something like that should solve your problem. :mellow:


Share this post


Link to post
Share on other sites

Something like that should solve your problem. :mellow:

Yes that's really helpful :party: Thanks so much

BTW, I'd like to check the registry for IE path, in case the user may change it or don't have IE installed.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\IEXPLORE.EXE

Sometimes when I launch the script, the GUI doesn't show after all and I have to use Task Manager to close IE and AutoIT. I think I will add the option -new so the IE instance created by the script won't conflict with others :P

Cheers

Share this post


Link to post
Share on other sites

Yes that's really helpful :P Thanks so much

BTW, I'd like to check the registry for IE path, in case the user may change it or don't have IE installed.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\IEXPLORE.EXE

Sometimes when I launch the script, the GUI doesn't show after all and I have to use Task Manager to close IE and AutoIT. I think I will add the option -new so the IE instance created by the script won't conflict with others :mellow:

Cheers

Never heard of the "-new" command. What is it for?

Share this post


Link to post
Share on other sites

Never heard of the "-new" command. What is it for?

Here is it, I copied from MSDN

The following table describes the supported command-line options for Internet Explorer.

-embedding : Used to start Internet Explorer via OLE Embedding (such as the WebBrowser Control).

-extoff : Internet Explorer 7 and later. Starts Internet Explorer in No Add-ons mode, which can be used to troubleshoot problems with browser add-ons. For more information, see Troubleshooting Internet Explorer Add-ons World Wide Web link.

-framemerging : Internet Explorer 8 and later. Allows Internet Explorer to opportunistically merge new frame processes into existing frame processes. For more information, see Internet Explorer 8 and Reliability World Wide Web link.

-k : Starts Internet Explorer in kiosk mode; the browser is opened in a maximized window that does not display the address bar, the navigation buttons, or the status bar.

-noframemerging : Internet Explorer 8 and later. Prevents Internet Explorer from opportunistically merging new frame processes into existing frame processes.

-private : Internet Explorer 8 and later. Starts Internet Explorer with InPrivate Browsing set to active. For more information, see InPrivate Browsing: Frequently Asked Questions World Wide Web link.

URL : After starting, Internet Explorer navigates to the page or resource specified as the URL.

The following table lists command-line options that have been superseded by other options, deprecated, or are obsolete. The options should no longer be used.

-channelband : Obsolete as of Internet Explorer 7.

-e : Obsolete as of Internet Explorer 7.

-eval : Obsolete as of Internet Explorer 7.

-nomerge : Available in pre-release versions of Internet Explorer 8; this option has been superseded by the -noframemerging option describe earlier.

-new : Obsolete as of Internet Explorer 7.

-nowait : Obsolete as of Internet Explorer 7.

-remote : Obsolete as of Internet Explorer 8.

-v : Obsolete as of Internet Explorer 8.

-version : Obsolete as of Internet Explorer 8.

Edit 1 : It seems that we can use only one parameter for the IE :P

Edit 2 : I'm using IE 8 so my script fails when using old paramteters :mellow:

Edited by Bot

Share this post


Link to post
Share on other sites

It's the strangest thing.

When I'm running Outlook 2010, the COM object will return an error when trying to access this property:

C:\Program Files\AutoIt3\Include\IE.au3 (2674) : ==> The requested action with this object has failed.:

Return SetError($_IEStatus_Success, 0, HWnd($o_object.HWnd()))

Return SetError($_IEStatus_Success, 0, HWnd($o_object.HWnd()^ ERROR

If I close Outlook 2010, it works flawlessly.

Can anyone confirm this?

footswitch


Share this post


Link to post
Share on other sites

Can this method use to upload file from IE embedded?

I'm not sure if I understand your question, but this object will allow you to perform every operation like you would with a regular Internet Explorer window.

That's the whole point of using this method instead of _IECreateEmbedded().


Share this post


Link to post
Share on other sites

This is pretty good, one thing is that they create multiple instances of iexplore.exe

@ motionman95 you example creates 2 instances, and only closes 1, could still hear the youtube video going on after the gui was closed and 1 instance was closed.

Its ok to work around, but would be much better if it didnt happen

Other than that pretty nice.

As the method opens additional IExplores in kiosk mode, there is no way around the additional processes. However, you can check for child processes, and close those before the main thread exists. This would allow you to close any and all IE windows that were opend beofre your main program closes.

You can find how to do that pretty simply by searching here in example scripts.


-_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë 맧ëñ§ë øƒ !ïƒë.

Share this post


Link to post
Share on other sites

I am running Outlook 2010 and cannot reproduce this with what you have given here. In an IE.au3 version long long ago, _IEAttach would fail this way when the Outlook Today screen was displaying in Outlook. Fixes for that were added to the IE.au3 version log ago however. Please insure that you are using the version that shipps with AutoIt in some recent version (current IE.au3 version is V2.4-1).

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

Also you may have some toolbars or other plugins in IE OR/AND Outlook2010 that are causing this.

@edit

Does anybody know why if i put $oIE.Navigate2("www.dir.bg", 2048) after _IEnavigate It gives error :

$oIE.Navigate2("www.dir.bg", 2048)^ ERROR - The requested action with this object has failed.

Even if a try to run the IE in normal mode - remove "-K" it gives the same error.

Edited by Juvigy

Share this post


Link to post
Share on other sites

@Juvigy - please don't hijack this thread with your Navigate2 question - please open a new one... especially since you've been sending me PMs about it as well.

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

Sorry about that.Thought that this is a suitable place to ask this q. as it is also a limitation of the embedded IE too.

Share this post


Link to post
Share on other sites

@Dale, thanks for your feedback regarding your experience with Outlook.

I confirmed the issue back then and it wasn't related to the IE.au3 version. HOWEVER, I have recently formatted the machine and the problem's gone.

Maybe it was a plugin issue, like @Juvigy mentioned.

Now, to the point. _IECreate2() has a "displaying" problem.

If I minimize and then restore the GUI, the IE "box" becomes partially invisible.

If I move the window around the edges of the screen, the same thing happens.

To display the invisible parts again, I currently need to scroll or refresh the page.

It seems like it is a drawing/redrawing issue, as if the GUI is putting itself on top of the IE box.

I have tested and confirmed this in several machines, either with Windows XP or Windows 7.

Any ideas as to prevent the issue?

Regards,

footswitch


Share this post


Link to post
Share on other sites

With the focus of this thread being on IE, the folks with the most knowledge and passion about the AutoIt GUI will side-step this post. I suggest that you create a new thread that focuses on the GUI expose issues and better yet, create a reproducer that uses a more mundane design not involving IE at all and ask for help with that.

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

With the focus of this thread being on IE, the folks with the most knowledge and passion about the AutoIt GUI will side-step this post. I suggest that you create a new thread that focuses on the GUI expose issues and better yet, create a reproducer that uses a more mundane design not involving IE at all and ask for help with that.

Dale

I appreciate your suggestion and I might do that.

I'll try to reproduce the problem without IE ;)

thanks


Share this post


Link to post
Share on other sites

This is a great alternative to an EmbeddedIE, although there is a little bit of an issue with focus. When running the example given, the IE that is created is given focus and seems to operate independently to the GUI. Meaning if the focus is on IE, you can press Alt-F4 to close just the IE but not the whole GUI. It also means the GUI isn't in focus when clicking the scrollbars. Not necessarily a bug, but does anyone know how to make sure the GUI is always given focus instead of IE?

Share this post


Link to post
Share on other sites

I'm bumping this old thread to add a precision :

You might want to add this after the _IEQuit($oIE) :

sleep(500)

Otherwise, because of multitasking, the destruction of your app and of the IE object might not finish in the right order, and cause and error "Internet Explorer has encountered an error and needs to close" (windows XP) or "Internet Explorer has stopped working" (Windows Vista/Seven)

A cleaner way to do this would be something like this :

While 1
    if not ProcessExists($pid) then exit   
Wend

('$pid' is the pid you got from the Run("iexplore.exe")" command)

Edited by MonsieurOUXX

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