Jump to content
Sign in to follow this  
zaxxon

Problem getting handle for IE

Recommended Posts

Hello all,

I have searched the web and the forum but didn't find an answer. I am new to AutoIt (using v3.3.14.2) and have a very basic questions:

 

#Include <IE.au3>

Local $oIE = _IECreate("someurl.org")

ConsoleWrite(@CRLF & "oIE: " & $oIE & @CRLF & @CRLF)

_IELoadWait($oIE)

WinMove($oIE, "", 0, 0, 1000, 600)

 

When I run it, it opens the IE, but when I check the console, the variable $oIE is empty. No object handle seems to be assigned to it.

The following WinMove() doesn't work since there is no object to use.

When I use additionaly _IEPropertyGet() to explicit get the handle and write it to a variable and write it to the console, it works. I can see the hex handle.

What am I doing wrong?

 

Thanks in forward!

 

Share this post


Link to post
Share on other sites

So far I found out that an object has been assigned to $oIE when I use a _IENavigate() just after the _IECreate(). Seems my error is, that this object can not just be used in another type of functions like WinMove() for example, unless I got it from _IEPropertiesGet()?

 

Thanks in forward for an enlightment.

Share this post


Link to post
Share on other sites

_IECreate returns an object variable, not an handle, this is because WinMove doesn't work with it.

Also, ConsoleWrite doesn't see the content of object variables and has a strange behavior with them (but it can print handles).

Share this post


Link to post
Share on other sites
#Include <IE.au3>

Local $oIE = _IECreate("someurl.org")

ConsoleWrite(@CRLF & "oIE: " & $oIE & @CRLF & @CRLF)

_IELoadWait($oIE)

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

WinMove($hWnd, "", 0, 0, 1000, 600)

 


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...