Jump to content

Recommended Posts

Posted

I looked through the forum and the manual, but I couldn't find an answer to this.

How can I get the text from the adress bar in an internet explorer window? The control ID is 41447.

Thanks,

aarnott

Posted

Thanks for taking a look, but that's not exactly what I meant (sorry!). :">

I mean I want to get the text from the address bar where you type in "www.autoitscript.com". I know how to put text into that bar, but the ControlGetText() function doesn't return anything. I'm not sure how to go about this.

Posted

Opt("WinTitleMatchMode", 2)  
WinWaitActive ( "Internet Explorer" )
$text = ControlGetText ( "Internet Explorer", "", 41477 )
  MsgBox(0, "", $text)

Posted

It just shows a blank message box, so it is returning nothing.

This is not possible 'cause WinWaitActive.

Check the ControlID, it is 41477 not 41447 !!!

Advanced version:

Opt("WinTitleMatchMode", 2) ;VERY IMPORTANT
$title = "Internet Explorer" 
$url = "Address is: "
$hwnd = "Handle is: "

$hwnd = $hwnd & ControlGetHandle ( $title, "", 41477 )

If $hwnd = "Handle is " then
 $hwnd = "No such ControlID"
Else
 $url = $url & ControlGetText ( $title, "", 41477 )
EndIf

MsgBox(0, $title, $url & @CRLF & $hwnd)

:)

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...