Jump to content

Recommended Posts

Posted (edited)

If I Open IE, navigate to some site by myself(manually), and then run this Code:

$oIE =_IEAttach("SomeURL...","url")

The attach operations Succeeds,

but when I try after that to do

WinFlash($oIE)

Or

WinActivate($oIE)

Both those functions, work on the Calling window(SciTE for example), and not on the IE window that I have just attached to.

that's despite the fact that whatever other operation I will do with $oIE, will succeed and work very well,

for example _IENavigate($oIE,$URL) will navigate with no problem.

just window operations like Activate or Flash don't work on the right window.

how can I fix this?

Edited by Zohar
Posted

As the above poster mentioned you cannot use the ie object as a parameter in Win* functions. Use _IEPropertyGet to get the hwnd of the ie window instead.

Example:

#include <ie.au3>

$ie=_IEAttach("http://www.google.se/","url")
WinFlash(_IEPropertyGet($ie,"hwnd"))

:)

Broken link? PM me and I'll send you the file!

Posted

To Authenticity:

All AutoIt's Win* functions that accept a window Title, also accept an hWnd pointer.

To monoceres:

You were right!!!

I added the _IEPropertyGet($oIE,"hwnd") part, as you said, and it solved it!!!

Thank you very much! :)

I always thought that because $oIE is a "window" object, then executing Widnow functions on it should work.

I'm glad it now works

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
×
×
  • Create New...