Jump to content

Launch a hidden IE instance and then perform actions in it?


Recommended Posts

I would like to launch an IE session using _IECreate, but I want to launch it hidden so the user can't see it, then once launched I want to be able to perform actions on that web page, for example I want to enter some text into an input box and click on a button.

How do I go about doing this in a hidden window? I can get it all working fine in a visible one, but I don't want the user to see anything.

I think I can create the window hidden using:

_IECreate ("http://www.google.co.uk", 0, 0)

But how do I perform actions on that page? the problem I see is that I can't use pixel search on a hidden window, I can't click a button on it, I can't even see the hidden window in Task Manager.

Edited by saldous
Link to comment
Share on other sites

Every IE.au3 example works equally well on an invisible window -- note that NONE of the IE.au3 examples use pixel search. Use the object model - and I hope you're not doing anything nefarious, because I'll regret helping you.

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

Hi, thanks, I'll give that a try. What I want to go it open a browser, navigate to a page, enter the users login credentials, click the login button and then unhide the window. So the time the user sees it it is already done all the work and on the page I want them to see, I don't want them to see it all happening.

Link to comment
Share on other sites

_IEAction($oIE, "visible")

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

oh, ok, thanks. I was looking at _IEPropertySet, no wonder I couldn't figure it out!

Yeah, sorry. _IEAction was created long before _IEPropertySet

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

Sorry, I have another question... Once the window becomes visible again, how to I set it to OnTop? At the moment it appears behind other open windows.

EDIT: Think I got it with: _IEAction($oIE, $GUI_ONTOP)

EDIT: Nope, that isn't it! Still need help.

EDIT: Got it, WinSetOnTop("Untitled - ", "", 1)

Edited by saldous
Link to comment
Share on other sites

Get the browser window handle and then you can use standard AutoIt Win* functions on it:

$hwnd = _IEPropertyGet($oIE, "hwnd")
WinActivate($hwnd)

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

ummm...you want to set IE to enter in data...and not let them know about it.....

You mind sharing on why one would need to do that? That is reaching toward the hacker side of things, and could be very easily be used for dark stuff...

No offence.....but this does seem quite sneaky and dark.

Link to comment
Share on other sites

ummm...you want to set IE to enter in data...and not let them know about it.....

You mind sharing on why one would need to do that? That is reaching toward the hacker side of things, and could be very easily be used for dark stuff...

No offence.....but this does seem quite sneaky and dark.

Asked and answered. See above.

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

ummm...you want to set IE to enter in data...and not let them know about it.....

You mind sharing on why one would need to do that? That is reaching toward the hacker side of things, and could be very easily be used for dark stuff...

No offence.....but this does seem quite sneaky and dark.

i have a couple of scripts that i made for work that have to do that. we have web resources that require my login, and i don't want the people whose computer i'm using to access them to be able to see my password, not even the length of the password.

Link to comment
Share on other sites

That's exactly what I'm trying to do Cameronsdad. I have no interest in hacking and don't get time to play games so I'm not making bots either. I'm simply trying to simplify some work tasks and make it as easy and unintrusive for users as possible.

Link to comment
Share on other sites

That's exactly what I'm trying to do Cameronsdad. I have no interest in hacking and don't get time to play games so I'm not making bots either. I'm simply trying to simplify some work tasks and make it as easy and unintrusive for users as possible.

one thing that you can do, depending on your comfort level with gui's, is remove the browser window from view completely. there are a few processes i've done at work here, where i've just made gui's to replace the forms that they would use, and navigate the browser completely in the background, as far as the end users are concerned, abstraction is 100%; they think that the program they're using replaced the webpage, rather than hiding it.
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...