|
肯定不行的.
可以参考yabest的代码,理解后改动改动就行。
一定要得到运行时的实际对象,然后遍历调用click。
SystemUtil.Run "C:\WINDOWS\system32\calc.exe","","C:\WINDOWS\system32","open"
HightLight_All_Object Window("regexpwndclass:=SciCalc").WinButton("text:=[0-9]")
Function Get_All_Runtime_Objects(TestObject, RuntimeObjects)
Dim Parent, Desc, Props, PropsCount
If IsEmpty(TestObject.GetTOProperty("parent")) Then
Set Parent = Desktop
Else
Set Parent = TestObject.GetTOProperty("parent")
End If
Set Desc = Description.Create
Set Props = TestObject.GetTOProperties
PropsCount = Props.Count - 1
For i = 0 to PropsCount
Desc(Props(i).Name).Value = Props(i).Value
Next
Set RuntimeObjects = Parent.ChildObjects(Desc)
Get_All_Runtime_Objects = RuntimeObjects.Count
End Function
Function HightLight_All_Object(TestObject)
Dim allRuntimeObjects
Dim objIndex, objNum
objNum = Get_All_Runtime_Objects(TestObject, allRuntimeObjects)
For objIndex = 0 to ObjNum-1
allRuntimeObjects.Item(objIndex).click
Next
End Function |
|