Jump to content

IE and ShellExecute


Recommended Posts

Howdy all.

I've got two questions for you scripting powers that be:

1) Ok, Im confused (but this time Im fairly sure its not something I did wrong! :) ). I was playing with the various _IE functions trying to do a little script that would create an IE kiosk and would reopen it anytime it was closed. While I was doing this, I found the ShellExecute command that, when I tested it on my desk machine with this code:

ShellExecute("C:\Program Files\Internet Explorer\iexplore.exe")

it worked perfectly. I then moved to my test machine and kept getting ShellExecute undefined function errors. I figured that I just hadnt updated Autoit and SciTE lately, so I did and now on the test machine ShellExecute is just opening an IE window that is most defiantly not behaving like a shell. Is this a change caused by different versions, or is it a windows thing?

My desk machine is running Autoit: 3.2.6.0 and SciTE: 1.74

My test machine is running Autoit: 3.2.10.0 and SciTe: 1.75

Question 2) the reason I was playing with this is I was trying to get this script to make IE behave like it was running in kiosk mode. I know about adding the /k switch after a run command, but I cant figure out how to do that with a _IECreate command. And Ive found out that if I dont have the _IECreate making the IE instance, the following _IEPropertySets dont activate.

; *******************************************************
;       ***Opac 'ie shell' loop v2***
;   this creates an endless loop where if the ie window
;   is closed, it reopens back to the catalog.
;               Mike W. 04/02/2008
; *******************************************************
;
#include <IE.au3>

Opt("WinTitleMatchMode", 2) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase
;above changes the matching for the winactivate below to match on just part of the title of the window

sleep(5000)
While 1
;below line commented out cause it's not doing what I want.
;$oIE = ShellExecute("C:\Program Files\Internet Explorer\iexplore.exe")

$oIE  = _IECreate ("catalog.mrrl.org")
_IEPropertySet ($oIE, "addressbar", "0")
_IEPropertySet ($oIE, "menubar", "0")
_IEPropertySet ($oIE, "toolbar", "0")
_IEPropertySet ($oIE, "contenteditable", "0")
_IEPropertySet ($oIE, "theatermode", "0")


sleep(2000)
WinActivate("Windows Internet Explorer", "")

WinSetOnTop("Windows Internet Explorer", "", 1);1=set on top flag, 0 = remove on top flag

 WinWaitNotActive("Microsoft Internet Explorer")
 
 Wend

The script is working fine - except for not being kiosked. So as always.... all help, suggestions, and criticism are very welcome.

Thanks!

"The three rules of the Librarians of Time and Space are: 1) Silence; 2) Books must be returned no later than the date last shown; and 3) Do not interfere with the nature of causality." Terry Pratchett - The Light Fantastic

Link to comment
Share on other sites

If you need to work on an existing IE instance, see _IEAttach

Don't know what you mean by "not behaving like a shell".

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

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