listview选中状态失效咋回事(已解决)
本帖最后由 www1970 于 2014-4-21 10:50 编辑制作加密软件TrueCrype(http://www.truecrypt.org/downloads可下载)自动加载程序时,在选择分区时,可以选中最后一个加密分区,但是“确定”按钮点击时,分区选择失效,这问题咋解决呀!
见下图
1、选中最后一个隐藏分区
2、点击“OK”按钮后
代码如下:
;启动truecrypt
Run("C:\Program Files\TrueCrypt\truecrypt.exe")
;界面启动后选择“选择设备”
WinWaitActive("TrueCrypt","Select D&evice...")
Send("!e")
;出现分区选择界面,选择最后一个分区
WinWait("Select a Partition or Device")
$itm=ControlListView("Select a Partition or Device","","SysListView321","GetItemCount")
ControlFocus("Select a Partition or Device","","SysListView321")
ControlListView("Select a Partition or Device","","SysListView321","Select",$itm-1)
;点击“OK”按钮
ControlFocus("Select a Partition or Device","","Button2")
ControlClick("Select a Partition or Device","","Button2") 请求增援! 高手请帮忙! 是这问题太低级了,高手不屑于回答,还是没碰到过不知如何解决呀?
俺很郁闷呀!
刚学就碰到这难题 回复 1# www1970
我也是新手。你这样选择不行的话,我换个思路,就是获取listview选中的文本,直接输入。你试试看Run("C:\Program Files\TrueCrypt\truecrypt.exe")
WinWaitActive("TrueCrypt","Select D&evice...")
ControlClick("TrueCrypt","Select D&evice...","Select D&evice...")
WinWait("Select a Partition or Device")
$itm=ControlListView("Select a Partition or Device","","SysListView321","GetItemCount")
$Device= ControlListView("Select a Partition or Device","","SysListView321","GetText",$itm-1)
ControlClick("Select a Partition or Device","","Cancel")
WinWaitActive("TrueCrypt","Select D&evice...")
ControlSetText("TrueCrypt","Select D&evice...","Edit1",$Device) 回复 5# 121044246
这个方法成功了,谢谢!!!! 回复 6# www1970
呵呵,可以就好。一起学习
页:
[1]