Read text of a control that is not shown under Visible Text using AutoIt Window Info tool

-1

I have a window inside which I have a Control. I can read the Class and Instance of this control using AutoIt Window Info Tool, but the Visible Text column does not display the text that is visible inside this control. Hence, I am not able to read the text using ControlGetText Function. Is there any other way to read this text? All I want to do is read the text that is being displayed under this control.

This is the info that I am getting in AutoIt Window Info. I can see a text "Sample text" in the control, but it's not available in the Visible Text tab

enter image description here

>>>> Window <<<<
Title:  Documents
Class:  CabinetWClass
Position:   80, 77
Size:   1355, 744
Style:  0x14CF0000
ExStyle:    0x00000100
Handle: 0x0000000000310B4A

>>>> Control <<<<
Class:  Internet Explorer_Server
Instance:   1
ClassnameNN:    Internet Explorer_Server1
Name:   
Advanced (Class):   [CLASS:Internet Explorer_Server; INSTANCE:1]
ID: 
Text:   
Position:   794, 87
Size:   545, 566
ControlClick Coords:    255, 174
Style:  0x56000000
ExStyle:    0x00000000
Handle: 0x0000000000BA08A2

>>>> Mouse <<<<
Position:   1137, 368
Cursor ID:  0
Color:  0xFFFFFF

>>>> StatusBar <<<<
1:  

>>>> ToolsBar <<<<

>>>> Visible Text <<<<
Address: C:\Users\some\path
Documents
Shell Preview Extension Host
Namespace Tree Control
Tree View
ShellView


>>>> Hidden Text <<<<
Namespace Tree Control
autoit
asked on Stack Overflow Jul 17, 2014 by rdp • edited Jul 18, 2014 by rdp

1 Answer

0

The control you are accessing is embed object instance of Internet Explorer. In order to attach to it, you can use _IEAttach using the mode "embedded".

; Attach to a browser control embedded in another window

#include <IE.au3>

Local $oIE = _IEAttach("A Window Title", "embedded")
Local $sText = _IEBodyReadText($oIE)
MsgBox(0, "Body Text", $sText)
answered on Stack Overflow Jul 23, 2014 by Milos

User contributions licensed under CC BY-SA 3.0