找回密码
 加入
搜索
查看: 1229|回复: 6

这种情况下如果获得ID

[复制链接]
发表于 2009-4-22 15:35:21 | 显示全部楼层 |阅读模式
本帖最后由 satech 于 2009-4-23 09:11 编辑

类似这个窗口下的item怎样才能得到他们的ID呢,我需要对它们里的任何一项做鼠标操作?

本帖子中包含更多资源

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

×
发表于 2009-4-22 16:01:56 | 显示全部楼层
在线等....对于此问题若大伙有头绪的,也不防说说,谢谢了!
发表于 2009-4-22 16:29:49 | 显示全部楼层
用 window Info  看看 那些是什么控件。。。。
发表于 2009-4-22 16:34:44 | 显示全部楼层
info只能读到窗口属性的ID,里面的items就读不到了。。。
发表于 2009-4-22 20:22:10 | 显示全部楼层
先看看是什么类型的控件,不过看楼主的图片,感觉像是自定义的控件,非windows标准控件,如果是自定义的控件那就不好操作了,如果是标准控件的话,au3的函数能操作的话最好,不行的可以用udf操作.
发表于 2009-4-22 23:54:17 | 显示全部楼层
第三方工具,很少见WINDOWS标准控件,实在不行,模拟操作吧,不过,判断起来或操作起来难度黑大。。
发表于 2009-4-23 08:55:13 | 显示全部楼层
我已经找到方法了,谢谢楼主给我post这个问题,也谢谢各位的发言。这次我把我总结的方法贴上来,供大家参考。BTW:写成了Func.
SelectListViewItem("", ,"")  ;param: 1 =->Window Name    ; 2 =->Control ID ; 3 =->Item Name 

Func SelectListViewItem($WinName,$ControlID,$ItemName)
        $ItemCount = ControlListView($WinName,"",$ControlID,"GetItemCount")
        For $i = 1  to $ItemCount Step 1                                       ;use Loop to find given Item Name
                $ItemText = ControlListView($WinName,"",$ControlID,"GetText",$i-1)
                if StringCompare($ItemName,$ItemText)=0 then
                        ControlListView ($WinName, "", $ControlID, "SelectClear")      ;Clears the selection of all items.
                        ControlListView ($WinName, "", $ControlID, "Select",$i-1)      ;Selects given item.
                        Return
                EndIf
        Next
EndFunc        

;---------------------------------------------------------------------------------------------------------------------------



SelectTreeItem("New",25280,"SN8 2800 Series Project")                    ;param: 1 =->Window Name    ; 2 =->Control ID ; 3 =->Item Name

Func SelectTreeViewItem($WinName,$ControlID,$ItemName)
        ControlTreeView ( $WinName, "",$ControlID, "Uncheck")                ;Unchecks an item (if the item selected).
        ControlTreeView ( $WinName, "",$ControlID, "Select" ,$ItemName)      ;Selects given item.
EndFunc





;---------------------------------------------------------------------------------------------------------------------------


;param: 1 =->Window Name    ; 2 =->Control ID ; 3 =->Item Name  BTW: ListBox can be use too
SelectComboBoxtem("Project Setting",7065,"Level 2")

Func SelectComboBoxtem($WinName,$ControlID,$ItemName)
        ControlCommand ( $WinName, "",$ControlID, "SelectString" , $ItemName) 
EndFunc
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-4-28 18:36 , Processed in 0.098999 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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