Sign in to follow this  
Followers 0
Solai

Application window embeds IE(HTML button) using ATL Library class CAxWindow

6 posts in this topic

Hi

We have an application which is written in VC++. This application window embeds IE using ATL Library class CAxwindow.

We have some HTML button in this application.Using AutoIt we try to click on the HTML button,but we can't capture the HTML button.

When used Microsoft Spy++ tool it gives the following hierarchy of windows.(Pls see the attached doc)....

How can click on the HTML button using AutoIt........Anybody guide me..

Regards,

Solai

post-22378-1179986491_thumb.jpg

Share this post


Link to post
Share on other sites



Also we try with _IEAttach() function also,but it will throw an error.

Help me.......

Share this post


Link to post
Share on other sites

You have not provided what you have tried or what errors you get when trying. Without this information no one will be able to help you.

Share this post


Link to post
Share on other sites

Hi,

I am Colleague of Solai I was able click on to the HTML button in Embedded IE window, but Iam not able to click on the Message box thrown by the HTML button.

I am attaching Code please give your suggestions so that I can click on message box button.

I have also attached Screen shot of the application.

#include <IE.au3>
Run("C:\Documents and Settings\karthikeyanc\Desktop\Test\Test\1\UsingDisc.exe")
WinSetOnTop("WebUIEvents","",1)
WinActivate("WebUIEvents","")
Sleep(1000)
$oIE = _IEAttach ("WebUIEvents","Embedded")
$button=$oIE.document.getElementById("image1")
$button.Click()
WinActivate("Nice try!!","You have clicked on HTML image")  
ControlFocus ("Nice try!!","You have clicked on HTML image",2)
ControlClick("Nice try!!","You have clicked on HTML image",2)

NiceTry.zip

Share this post


Link to post
Share on other sites

HI,

In the code which I have attached "$button.Click()" waits for browser to respond,

since browser is not reponding we are not able to proceed to the next line in hte script.

Please let me know how to come out after clicking on the button and proceed with the next line.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

My guess would be that the Javascript behind the button is such that control is not being returned to AutoIt after the .Click UNTIL you acknowledge the alert dialog. Thus, your WinActivate never gets a chance to run.

To work around this you must activate the button without getting sucked into the event processing logic. Fortunately, AutoIt provides you a simple way to do this by sending simulated keyboard strokes:

$oIE = _IEAttach ("WebUIEvents","Embedded")
$button=$oIE.document.getElementById("image1")
$button.focus()
Send("{SPACE}")

Let us know how you do.

Dale

Edit: You'll notice that I used SPACE in one example above and ENTER in the other... with buttons you can typically use either, to activate elements like Links you need to use ENTER

Edited by DaleHohm

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

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