﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
2356	ControlGetText return blank string, but Window Info tool work without fail	anonymous		"ControlGetText and Window Info tool seems work differently and while second get result without fail, fist return blank string.

{{{
>>>> Control <<<<
Class: Static
Instance: 5
ClassnameNN: Static5
Name:
Advanced (Class): [CLASS:Static; INSTANCE:5]
ID: 1002
Text: ftp1-zlb.vips.scl3.mozilla.com, HTTP (TCP:80) <--------------- this string
Position: 196, 102
Size: 284, 24
ControlClick Coords: 60, 10
Style: 0x50024000
ExStyle: 0x00000004
Handle: 0x00C805F6

>>>> Visible Text <<<<
Static
Static
Static
Static
Static
Button
Button
Button
Button
ComboBox
Button
Button
Static
Button
Button
Static
SysLink
}}}

discussion can be seen here:
[http://www.autoitscript.com/forum/topic/150535-getting-text-from-control-the-window-info-tool-way/?hl=controlgettext#entry1077799]

script that reproduces the problem:

{{{
#include
#include
$a = WinList ( ""Outpost Firewall Pro"" )
For $i = 1 To $a[0][0]
Var_GetAllWindowsControls2($a[$i][1])
Next

Func Var_GetAllWindowsControls2($hCallersWindow)
; Get all list of controls
$sClassList = WinGetClassList($hCallersWindow)
; Create array
$aClassList = StringSplit($sClassList, @CRLF, 2)
; Sort array
_ArraySort($aClassList)
_ArrayDelete($aClassList, 0)
; Loop
$iCurrentClass = """"
$iCurrentCount = 1
$iTotalCounter = 1
For $i = 0 To UBound($aClassList) - 1
If $aClassList[$i] = $iCurrentClass Then
$iCurrentCount += 1
Else
$iCurrentClass = $aClassList[$i]
$iCurrentCount = 1
EndIf
$hControl = ControlGetHandle($hCallersWindow, """", ""[CLASSNN:"" & $iCurrentClass & $iCurrentCount & ""]"")
;$text = StringRegExpReplace(ControlGetText($hCallersWindow, """", $hControl),""[\n\r]"",""[email=""{@CRLF""]{@CRLF[/email]}"")
$text = ControlGetText($hCallersWindow, """", $hControl)
$aPos = ControlGetPos($hCallersWindow, """", $hControl)
$sControlID = _WinAPI_GetDlgCtrlID($hControl)
If IsArray($aPos) Then
ConsoleWrite(""ControlCounter=["" & $iTotalCounter & ""] ControlID=["" & $sControlID & ""] Handle=["" & $hControl & ""] ClassNN=["" & $iCurrentClass & $iCurrentCount & ""] XPos=["" & $aPos[0] & ""] YPos=["" & $aPos[1] & ""] Width=["" & $aPos[2] & ""] Height=["" & $aPos[3] & ""] Text=["" & $text & ""]."" & @CRLF)
Else
ConsoleWrite(""ControlCounter=["" & $iTotalCounter & ""] ControlID=["" & $sControlID & ""] Handle=["" & $hControl & ""] ClassNN=["" & $iCurrentClass & $iCurrentCount & ""] XPos=[winclosed] YPos=[winclosed] Width=[winclosed] Height=[winclosed] Text=["" & $text & ""]."" & @CRLF)
EndIf
If Not WinExists($hCallersWindow) Then ExitLoop
$iTotalCounter+=1
Next
EndFunc
}}}
"	Bug	closed		AutoIt	Other	None	Works For Me		
