找回密码
 加入
搜索
查看: 2170|回复: 1

关于LISTVIEW的问题

[复制链接]
发表于 2008-6-19 11:09:46 | 显示全部楼层 |阅读模式


我要实现的动作是:程序能够自动找到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,但是按“回车”不起作用。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2008-10-27 17:23:07 | 显示全部楼层
用ControlClick 双击左键,应该可以,你看下这个命令
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-12-22 21:58 , Processed in 0.080601 second(s), 26 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表