Jump to content
Sign in to follow this  
kasarah

Compiled App uses WebBrowser

Recommended Posts

kasarah

This is similar to previous post, but thought I could be more descriptive of my problem.

I have a compiled App already running in windows and its functionality uses ActiveX webbrowser controls. I can get a "handle by using

$handle=WinGetHandle("App Title"), however, I'm beginning to wonder if it's the *right* handle. If I really want to apply IE.au3 functionality to this window, do I need to use a handle from IECreate? Unfortunately, this is an app and has no URL, but has IE functionality. It seems to be this weird hybrid that isn't really windows, and doesn't show up for IE.

Will the handle code work for IE stuff that I have below? Seemingly, it is not working for me. Am I doing something wrong to grab an existing IE window?

Thanks again in advance for any help.

B

#include-once

#include <file.au3>

#include <IE.au3>

$handle=WinGetHandle("App Title")

$oIE=_IECreate("",1,1,0,0) ; Attempting to grab existing window, but doesn't work. Launches a new one.

If @error Then

MsgBox(4096, "Error", "Could not find the correct window")

_FileWriteLog(".\test.log", "Error")

Else

_FileWriteLog(".\test.log", "Found Handle")

_FileWriteLog(".\test.log", "IEReadText = " & _IEBodyReadText($handle))

_FileWriteLog(".\test.log", "IEBODYREADHTML = " & _IEDocReadHTML($handle))

_FileWriteLog(".\test.log", "WinGetText =" & WinGetText("App Title"))

_FileWriteLog(".\test.log", "Is it a frameset? (1 if true) =" & _IEIsFrameSet($handle))

$oForm = _IEFormGetCollection($handle)

_FileWriteLog(".\test.log", "oForm =" & $oForm)

$propval=_IEPropertyGet($handle, "appname")

_FileWriteLog(".\test.log", "property value inner html is " & $propval)

WinMove("Cisco NAC Agent","",10,10)

Endif

Output:

2008-05-05 15:56:44 : Found Handle

2008-05-05 15:56:44 : IEReadText = 0

2008-05-05 15:56:44 : IEBODYREADHTML = 0

2008-05-05 15:56:44 : WinGetText =

2008-05-05 15:56:44 : Is it a frameset? (1 if true) =0

2008-05-05 15:56:44 : oForm =0

2008-05-05 15:56:44 : property value inner html is 0

Share this post


Link to post
Share on other sites
MikeP

handle is generic.. it's like asking if the desktopWidth means something in a function and something else in another .. desktopWidth is.. the desktop width so yeah.. handle returned by WinGetHandle can be used wherever you see a function parameter called handle.

Did you try _IEAttach() ?

edit : nvm ...I re-read.. you're trying to attach an application though in those functions description it's said it needs to be an Internet Explorer Window .. I guess you can't do it (with IE.au3)

Edited by MikeP

Share this post


Link to post
Share on other sites
kasarah

handle is generic.. it's like asking if the desktopWidth means something in a function and something else in another .. desktopWidth is.. the desktop width so yeah.. handle returned by WinGetHandle can be used wherever you see a function parameter called handle.

Did you try _IEAttach() ?

edit : nvm ...I re-read.. you're trying to attach an application though in those functions description it's said it needs to be an Internet Explorer Window .. I guess you can't do it (with IE.au3)

Hey Mike,

Thank you for taking the time to reply and confirm my $handle is ok.. I thought it was, because I could move the window around, but kinda lost my confidence when I couldn't do anything inside this app.

Just FYI.. I thought this might help troubleshoot, but this is my "Auto v3 Window Info" Ahh!! I just saw the help indicate Explorer_Server1 means I should be able to attach in this way!!

Thanks, that may be the clue I need! I'll post.

>>>> Window <<<<

Title: Window Title

Class: AGENTHTMLUI

Position: 523, 30

Size: 773, 569

Style: 0x14CC0000

ExStyle: 0x00000100

Handle: 0x001F02FC

>>>> Control <<<<

Class: Internet Explorer_Server

Instance: 1

ClassnameNN: Internet Explorer_Server1

ID:

Text:

Position: 0, 0

Size: 765, 535

ControlClick Coords: 76, 383

Style: 0x56000000

ExStyle: 0x00000000

Handle: 0x0011040A

>>>> Mouse <<<<

Position: 603, 443

Cursor ID: 2

Color: 0xFFFFFF

>>>> StatusBar <<<<

>>>> Visible Text <<<<

>>>> Hidden Text <<<<

Share this post


Link to post
Share on other sites
MikeP

I agree.. Autoit Window Info is magic :)

Share this post


Link to post
Share on other sites
DaleHohm

I expect you can use _IEAttach($handle, "embedded")

make sure you are using the AutoIt 3.2.11.x beta however as a DllCall bug in 3.2.10.x will cause this to fail.

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
kasarah

I expect you can use _IEAttach($handle, "embedded")

make sure you are using the AutoIt 3.2.11.x beta however as a DllCall bug in 3.2.10.x will cause this to fail.

Dale

Man,

I don't care what those other guys say, you guys ROCK! I was futzing and futzing and didn't have the beta. Looked back here, and voila!

That's going to save me a world of pain to go to somewhere I didn't want to go. Virtual Margarita's all around! Put it on my tab! Cinco de Mayo!!

Thanks again to all who helped!

B

#include-once

#include <file.au3>

#include <IE.au3>

$handle=WinGetHandle("Cisco NAC Agent")

$oIE= _IEAttach($handle,"Embedded")

_FileWriteLog(".\test.log", "IEReadText = " & _IEBodyReadText($oIE))

Outputs:

indv_actions_panel

Your userid and/or password is invalid

Version : 2.6.1.002

Username:

Password:

Remember Me

Server:Local DB

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  

×