Sign in to follow this  
Followers 0
Docfxit

Working with IE windows

44 posts in this topic

I'm getting a syntax error on the Msgbox line.

#include <Array.au3>

    $aWinList = WinList("[CLASS:#32770; TITLE:WordPerfect Office X6", "")
    MsgBox(64, "$aWinList", _ArrayDisplay($aWinList, "Win List")

 

Could I please get some help in resolving the syntax error?

Thank you,

Docfxit

Share this post


Link to post
Share on other sites



I believe you need to close the brackets.  You have a left-bracket before CLASS, and no end bracket (likely one is needed after X6).

Hope that helps...this is my first post here.  :bye:

Share this post


Link to post
Share on other sites

You are correct.  Thanks for the help.

Docfxit

Share this post


Link to post
Share on other sites

I'm trying to figure out why I'm not getting anything in the array in this code:

#include <Array.au3>



    $aWinList = WinList("[CLASS:#32770; TITLE:WordPerfect Office X6", "")

    MsgBox(64, "$aWinList", _ArrayDisplay($aWinList, "Win List"))

post-6489-0-12224700-1370885167_thumb.jp

post-6489-0-79000400-1370885287_thumb.jp

Nothing shows up in the array even though the window is active.

Thanks,

Docfxit

Share this post


Link to post
Share on other sites

I added the end bracket.  I'm not getting a syntax error any more.

Thanks,

Docfxit

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

So the code I posted is working for you now?

The code you posted in >post #4 still didn't have the end bracket, which will not pop a syntax error since it's a valid string as a parameter.

I'm guessing the syntax error you corrected was adding a closing parentheses to the message box.  I'm talking about the missing bracket that I added in for you here:

$aWinList = WinList("[CLASS:#32770; TITLE:WordPerfect Office X6]", "")

Edited by danwilli

Share this post


Link to post
Share on other sites

That's super.  Thank you very much.  That fixed it.  I didn't see the change you made the first time.

Thanks,

Docfxit

Share this post


Link to post
Share on other sites

I'm getting an error 7 = No Match on _IEAttach

#include <Array.au3>



$aWinList = WinList("[CLASS:#32770; TITLE:WordPerfect Office X6]", "")

For $n = 1 To $aWinList[0][0]

    MsgBox(64, "$aWinList", _ArrayDisplay($aWinList, "Win List") & @CRLF & "-" & $n & "-")



    ; Test for Instance IE

    $oIE = _IEAttach("[$aWinList[$n][1]; INSTANCE:1]")

    MsgBox(64, "$oIE", $oIE & @CRLF & "-" & @error & "-")



Next

post-6489-0-08237800-1370888726_thumb.jp

I don't understan why I wouldn't be getting error 0 = No Error.

Thanks,

Docfxit

Share this post


Link to post
Share on other sites

Try defining the $s_mode parameter as "Embedded":

$oIE = _IEAttach("[$aWinList[$n][1]; INSTANCE:1]", "Embedded")

Share this post


Link to post
Share on other sites

_IEAttach("[$aWinList[$n][1]; INSTANCE:1]")

This is a string. You need to use this instead.

_IEAttach("[" & $aWinList[$n][1] & "; INSTANCE:1]")

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

This is a string. You need to use this instead.

_IEAttach("[" & $aWinList[$n][1] & "; INSTANCE:1]")

/facepalm

Haha, I totally focused on the wrong spot, jumping straight to "Embedded" and posting the same mistake back to the OP.  Thanks BrewMan

Share this post


Link to post
Share on other sites

 

Try defining the $s_mode parameter as "Embedded":

$oIE = _IEAttach("[$aWinList[$n][1]; INSTANCE:1]", "Embedded")

I'm still getting error 7 = No Match on _IEAttach

Share this post


Link to post
Share on other sites

This is a string. You need to use this instead.

_IEAttach("[" & $aWinList[$n][1] & "; INSTANCE:1]")

I'm still getting error 7 = No Match on _IEAttach

Share this post


Link to post
Share on other sites

It's possible that I solved one problem and BrewMan solved another.

Try combining them.

_IEAttach("[" & $aWinList[$n][1] & "; INSTANCE:1]", "Embedded")

Let us know how it goes.

Share this post


Link to post
Share on other sites

Try it without using the instance parameter, also it might not be considered an Internet Explorer browser which is why it won't find it.

One other thing, what does $aWinList[$n][1] contain? Is there a valid handle in that element?


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

It's possible that I solved one problem and BrewMan solved another.

Try combining them.

_IEAttach("[" & $aWinList[$n][1] & "; INSTANCE:1]", "Embedded")

Let us know how it goes.

Thanks for taking a stab at it.

I'm still getting error 7 = No Match on _IEAttach

Share this post


Link to post
Share on other sites

#18 ·  Posted (edited)

Try it without using the instance parameter, also it might not be considered an Internet Explorer browser which is why it won't find it.

One other thing, what does $aWinList[$n][1] contain? Is there a valid handle in that element?

Thanks for the suggestion.

I tried:

$oIE = _IEAttach("[" & $aWinList[$n][1] & "]")

I'm still getting error 7 = No Match on _IEAttach

$aWinList contains this:

post-6489-0-69536600-1370894916_thumb.jp

$n contains 1

Thank you very much for the help.

Docfxit

Edited by Docfxit

Share this post


Link to post
Share on other sites

Try this, seeing as how you're using a handle instead of a title string.

$oIE = _IEAttach("[" & $aWinList[$n][1] & "]", "HWND")

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

Try this, seeing as how you're using a handle instead of a title string.

 

$oIE = _IEAttach("[" & $aWinList[$n][1] & "]", "HWND")

Thanks for the suggestion.

I'm still getting error 7 = No Match on _IEAttach

If you think I'd be better off using a title I'd be happy to.

What would the string look like?

Thanks,

Docfxit

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