|
发表于 2008-5-14 12:53:42
|
显示全部楼层
源代码在 http://www.au3.net.cn/ShowPost.asp?ThreadID=1991 。但好像下不了了
关键的函数在线下面,返回窗口标题为$title的所有控件的数组。
Func _GetClasses($title)
;Get array of each control
Local $buttonCount = 0, $editCount = 0, $staticCount = 0, $i
Local $classes = StringSplit( WinGetClassList($title) , @LF)
Local $classIDs[$classes[0]+1]
Local $count[1][2]
$classIDs[0] = $classes[0]
For $i = 1 to $classes[0]
Select
Case $classes[$i] = "Button"
$buttonCount = $buttonCount + 1
$classIDs[$i] = $classes[$i] & $buttonCount
Case $classes[$i] = "Edit"
$editCount = $editCount + 1
$classIDs[$i] = $classes[$i] & $editCount
$classes[$i] = "Input"
Case $classes[$i] = "Static"
$staticCount = $staticCount + 1
$classIDs[$i] = $classes[$i] & $staticCount
$classes[$i] = "Label"
Case Else
If StringStripWS($classes[$i],3) <> "" Then
$back = _Name2Link($classes[$i],$count)
If $back = 0 Then
ReDim $count[UBound($count)+1][2]
$count[UBound($count)-1][0] = $classes[$i]
$count[UBound($count)-1][1] = 1
$classIDs[$i] = $classes[$i] & 1
Else
$classIDs[$i] = $count[$back][0] & ($count[$back][1]+1)
$count[$back][1] +=1
EndIf
EndIf
EndSelect
Next
Local $classIDs2[1]
For $i = 1 to $classIDs[0]
If StringStripWS($classIDs[$i],3) <> "" Then
ReDim $classIDs2[UBound($classIDs2)+1]
$classIDs2[UBound($classIDs2)-1] = $classIDs[$i]
EndIf
Next
;Display the results
Local $output = ""
For $i = 1 to UBound($classIDs2) -1
$output = $output & $classIDs2[$i] & @LF
Next
Return $output
EndFunc
[ 本帖最后由 cai_super 于 2008-5-14 13:04 编辑 ] |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?加入
×
|