GPaul Posted April 22, 2015 Share Posted April 22, 2015 I am trying to make a script to open two Intranet sites in tabs in one IE window and then maximize the window. I'm using the following code. #include <IE.au3> $oIE = _IECreate("intranetsite1") __IENavigate($oIE, "intranetsite2", 0, 0x800) $HWND = _IEPropertyGet($oIE, "hwnd") WinSetState($HWND, "", @SW_MAXIMIZE) _IEAction($oIE, "visible") _IELoadWait($oIE) When I run the script IE opens and goes to the first page but then nothing else happens. If I modify the code so the _IECreate points to an internet site it then also opens a second tab with the second site and then maximizes as expected. I see this behavior no matter what intranet site I put in the _IECreate line. Is there a way to get this to work with intranet sites? Thanks Link to comment Share on other sites More sharing options...
MuffinMan Posted April 22, 2015 Share Posted April 22, 2015 (edited) I tried the code and inserted in 2 of my intranet pages and it worked just fine. I even tried the short name (http://servername ) and the fully qualified name (http://servername.domain.org) and both worked. Edited April 22, 2015 by MuffinMan Link to comment Share on other sites More sharing options...
MikahS Posted April 22, 2015 Share Posted April 22, 2015 Are you using a modified _IENavigate? As, that function should only take 3 parameters. Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4 Feel free to use any of my code for your own use. Forum FAQ Link to comment Share on other sites More sharing options...
GPaul Posted April 22, 2015 Author Share Posted April 22, 2015 I'm using __IENavigate instead of _IENavigate to make it open in a new tab instead of the same tab. It really appears this has something to do with the site in _IECreate being seen as an Intranet site by IE. If I rem out the __IENavigate line the window does not maximize with an Intranet site in _IECreate, but does with an Internet site, such as www.google.com. However if I then put www.google.com in the Intranet Zone in IE it no longer maximizes. Link to comment Share on other sites More sharing options...
MikahS Posted April 22, 2015 Share Posted April 22, 2015 Try using ShellExecute then, just have a look at the 5th example for _IECreate and see if that does what you would like. Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4 Feel free to use any of my code for your own use. Forum FAQ Link to comment Share on other sites More sharing options...
GPaul Posted April 22, 2015 Author Share Posted April 22, 2015 So I figureed out if I wait a few seconds after the _IECreate and then use _IEAttach to attach to the window that was just opened everything else works fine. Thanks for the help, it got me thinking about delays. I'll post my final code just incase anybody is interested. #include <IE.au3> $oIE = _IECreate("intranet1") sleep(3000) $oIE = _IEAttach("intranet1") __IENavigate($oIE, "intranet2", 0,0x800) $HWND = _IEPropertyGet($oIE, "hwnd") WinSetState($HWND, "", @SW_MAXIMIZE) _IEAction($oIE, "visible") Link to comment Share on other sites More sharing options...
MikahS Posted April 22, 2015 Share Posted April 22, 2015 Glad you found a solution to your needs. Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4 Feel free to use any of my code for your own use. Forum FAQ Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now