Sign in to follow this  
Followers 0
saldous

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

15 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

How do I un-hide a hidden IE window? I've tried the @SW_SHOW but it doesn't work on the following:

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

:-D Perfect, thank you.

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
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.


1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
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.

Share this post


Link to post
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.

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
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
Sign in to follow this  
Followers 0