Jump to content

_IECreateEmbedded different from regular IE in Win 7?


 Share

Recommended Posts

So I have a script that I wrote that opens a php page that has an input type box, a 'browse' button for the box, and a submit button. The 'browse' button does not appear if I am viewing the web page in the full version of IE, only the embedded one. This is not true on WinXP, only on Win7 (idk about Vista, skipped that).

On WinXP, opening the page, using _IEAction(<Control>, "focus") and then Send("Text") works, and I can submit the form using _IEFormSubmit.

However, on Win 7, using _IECreateEmbedded brings up a different kind of IE it seems? The same actions instead bring up a dialog box like I had clicked on the 'browse' button; _IEAction gives me an error at the _IEisObjType line.

I can still click on it manually and type, but it's greyed out a little, unlike if I open it up from IE on the desktop.

I tried to set compatibility mode in the settings, but it appears to make no difference. Working with the new AutoIt Beta version didn't seem to make a difference either.

I can't use IECreate2 as referenced elsewhere as it prevents you from using the username/password in the URL if you do, whereas IECreateEmbedded allows it. (yes, bad practice I know, but it's internal for an internal site).

I also can't use the alternate method of clicking on the button with the mouse as the pop up box halts the script in entirety.

Edited by Alodar
Link to comment
Share on other sites

  • 2 weeks later...

I found a workaround, for anyone interested. Even though it brings up a file choose dialog, the event from 'Send' is still active, and responds (albeit a tad slowly). Using send with a large amount of spaces in front works out in the end, as a trim of some sort is applied before the item.

So, choosing the input box to get focus and then using send still works (as shown below).

GUICreate("Load Tool", 660, 500, (@DesktopWidth - 640) / 2, (@DesktopHeight - 580) / 2, $DS_MODALFRAME + $WS_CAPTION + $WS_SYSMENU + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN)
$GUIActiveX = GUICtrlCreateObj($oIE, 10, 10, 640, 480)
GUISetState(@SW_SHOW)
 
_IENavigate($oIE, "<Redacted for work reasons>")
_IELoadWait($oIE)
 
$oForm = _IEFormGetCollection($oIE, 0)
$FileChoice = _IEGetObjByName($oIE, "uploaded")
_IEAction($FileChoice, "focus")
  Send("                                                                                                                          " & $FileName & "{ENTER}")
Sleep(5000)
_IEFormSubmit($oForm)
_IELoadWait($oIE)
Edited by Alodar
Link to comment
Share on other sites

Suggest you upgrade to the latest AutoIt beta for related fixes.

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

×
×
  • Create New...