|
我要实现的动作是:程序能够自动找到test-pc这台电脑,并且找到后选择test-pc这台电脑,然后按照“回车”
代码如下:
$handle=WinGetHandle("Select Bluetooth Device")
$ctrl=ControlGetHandle("Select Bluetooth Device","","sysListView321")
$i=ControlListView($handle,"",$ctrl,"GetItemCount")
$j=0
Do
Dim $num0,$num1,$num2,$num3
$edit1=ControlListView($handle,"",$ctrl,"GetText",$j,0)
$j=$j+1
$num=StringCompare("$edit1","test-pc")
if $num =0 Then
ControlFocus("Bluetooth File Transfer Wizard","","Button2")
;ControlListView($handle,"",$ctrl,"SelectAll")
Sleep(1000)
Send("{enter}")
Send("{enter}")
ElseIf $num <>0 Then
Send("{right}")
$num1=StringCompare("$edit1","test-pc")
ElseIf $num1=0 Then
ControlFocus("Bluetooth File Transfer Wizard","","Button2")
Sleep(1000)
Send("{enter}")
Send("{enter}")
ElseIf $num2<>0 Then
Send("{down}")
$num2=StringCompare("$edit1","test-pc")
Elseif $num2=0 Then
ControlFocus("Bluetooth File Transfer Wizard","","Button2")
Sleep(1000)
Send("{enter}")
Send("{enter}")
ElseIf $num2<>0 Then
Send("{left}")
$num3=StringCompare("$edit1","test-pc")
ElseIf $num3=0 Then
ControlFocus("Bluetooth File Transfer Wizard","","Button2")
Sleep(1000)
Send("{enter}")
Send("{enter}")
EndIf
Until $num=0 Or $num1=0 Or $num2=0 Or $num3=0
所遇到问题:能够选择到test-pc,但是按“回车”不起作用。 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?加入
×
|