Jump to content

_IECreate Opens two windows


russell
 Share

Recommended Posts

When i use the code

_IECreate("http://www.mywebpage.com",0,1,1,0)
it opens the webpage correctly but also opens the homepage in another window. how do i stop this from happening?

Look at the option in IE for home page, I think you can change it there so that it only opens one page.
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

See the "IE.au3 issues with Vista - Workarounds" link 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

Link to comment
Share on other sites

I assume it only happens with that specific URL? Assuming so, dig into that page and figure out what is different about it.

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

Link to comment
Share on other sites

This does not happen on my WinXP Professional computer, I would go with the advice to look at your browser settings and see if it is set to open the home page as well as any linked page when it starts up.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

  • 4 years later...

Hi Folks,

I am a newbie in autoIt and also facing the same issue. I am using below script, it opens another IE page which is blank. Is there any way to close this another IE window? Appreciate the help.

$oIE = _IECreate($TargetAddress,1)
$HWND = _IEPropertyGet($oIE, "hwnd")
WinSetState($HWND, "", @SW_MAXIMIZE)

Thanks,

PD

Link to comment
Share on other sites

Code only 1 GUI should always work

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Version=Beta
#AutoIt3Wrapper_Icon=..\Anonymous_emblem.ico
#AutoIt3Wrapper_UseUpx=y
#AutoIt3Wrapper_Add_Constants=n
#AutoIt3Wrapper_Run_Tidy=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#Region Includes
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
#EndRegion Includes

Opt('GUIOnEventMode', 1)
$Browser = _IECreateEmbedded()

#Region GUI

$Form1 = GUICreate("Advertise", 402, 122, @DesktopWidth - 870, @DesktopHeight - 550)
$Obj1 = GUICtrlCreateObj($Browser, 0, 0, 401, 73)
$Button1 = GUICtrlCreateButton("Continue", 312, 88, 81, 25)
GUICtrlSetState(-1, $GUI_DISABLE)
GUISetState(@SW_SHOW)
_IENavigate($Browser, "http://adf.ly/1I5oEA")
GUISetOnEvent($GUI_EVENT_CLOSE, "Beenden")
GUICtrlSetOnEvent($Button1, "Con")
#EndRegion GUI

#Region While
While 1
    $url = $Browser.document.url
    If $url = "https://www.autoitscript.com/forum/topic/121720-_iecreate-opens-two-windows/" Then
        GUICtrlSetState($Button1, $GUI_ENABLE)
        _IENavigate($Browser, "https://www.autoitscript.com/forum/topic/121720-_iecreate-opens-two-windows/")
        Sleep(1000)
    EndIf
WEnd
#EndRegion While

#Region Functions
Func Con()
    GUISetState(@SW_HIDE)
    MsgBox("Survey Acception", "Thanks for completing this little survey", -1)
EndFunc   ;==>Con
Func Beenden()
    Exit
EndFunc   ;==>Beenden
#EndRegion Functions

 

Edited by RaiNote
  • C++/AutoIt/OpenGL Easy Coder
  • I will be Kind to you and try to help you
  • till what you want isn't against the Forum
  • Rules~

 

Link to comment
Share on other sites

Hi Folks,

I am a newbie in autoIt and also facing the same issue. I am using below script, it opens another IE page which is blank. Is there any way to close this another IE window? Appreciate the help.

$oIE = _IECreate($TargetAddress,1)
$HWND = _IEPropertyGet($oIE, "hwnd")
WinSetState($HWND, "", @SW_MAXIMIZE)

Thanks,

PD

​Hi Folks,

Any help on this?

Thanks,

PD

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