autoit UIA获取Listview的信息
#include "CUIAutomation2.au3" Opt( "MustDeclareVars", ) Global $oUIAutomation MainFunc() Func MainFunc() ; Be sure to use the right class if you are on Vista or Windows
Local $hWindow = WinGetHandle( "[CLASS:CabinetWClass]", "" ) ; Windows Explorer, Windows
;Local $hWindow = WinGetHandle( "[CLASS:ExploreWClass]", "" ) ; Windows Explorer, Windows XP
If Not $hWindow Then Return $oUIAutomation = ObjCreateInterface( $sCLSID_CUIAutomation, $sIID_IUIAutomation, $dtagIUIAutomation )
If Not IsObj( $oUIAutomation ) Then Return Local $pWindow
$oUIAutomation.ElementFromHandle( $hWindow, $pWindow )
If Not $pWindow Then Return Local $oWindow = ObjCreateInterface( $pWindow, $sIID_IUIAutomationElement, $dtagIUIAutomationElement )
If Not IsObj( $oWindow ) Then Return ListAllItems( $oWindow, ) ; = List view element
; Run the code in post # to get this value EndFunc Func ListAllItems( $oWindow, $iCtrlType ) Local $pCondition
$oUIAutomation.CreatePropertyCondition( $UIA_ControlTypePropertyId, $iCtrlType, $pCondition )
If Not $pCondition Then Return Local $pUIElementArray, $oUIElementArray, $iElements
$oWindow.FindAll( $TreeScope_Descendants, $pCondition, $pUIElementArray )
$oUIElementArray = ObjCreateInterface( $pUIElementArray, $sIID_IUIAutomationElementArray, $dtagIUIAutomationElementArray )
$oUIElementArray.Length( $iElements )
If Not $iElements Then Return Local $pUIElement, $oUIElement, $name, $sel
For $i = To $iElements -
$oUIElementArray.GetElement( $i, $pUIElement )
$oUIElement = ObjCreateInterface( $pUIElement, $sIID_IUIAutomationElement, $dtagIUIAutomationElement ) $oUIElement.GetCurrentPropertyValue( $UIA_NamePropertyId, $name )
$oUIElement.GetCurrentPropertyValue( $UIA_SelectionItemIsSelectedPropertyId, $sel )
ConsoleWrite( $name & " " & $sel & @CRLF )
Next EndFunc
autoit UIA获取Listview的信息的更多相关文章
- android利用ContentResolver访问者获取手机联系人信息
转载自:http://www.jb51.net/article/106379.htm 首先需要在AndroidManifest.xml文件中添加权限: <uses-permission andr ...
- sql 2012中获取表的信息,包含字段的描述
1.获取数据库中的表 select name from sysobjects where type='U' 2.获取表字段(此处是Route表) Select name from syscolumns ...
- ThinPHP命名空间,连接数据库是要修改的配置文件,Model数据模型层,跨控制器调用,如何获取系统常量信息,
一.命名空间(主要是为了实现自动加载类) *命名空间(相当于虚拟的目录),为了让类有一个统一的文件夹来管理(可以自动加载'类'),每个文件都要有命名空间*tp如何做命名空间:*TP框架下有一个初始命名 ...
- 获取应用程序信息.h
//// 获取应用程序信息.h// IOS笔记// 一般会用来判断是否有新版本.是否需要强制更新 iOS的版本号,一个叫做Version,一个叫做Build,这两个值都可以在Xcode 中选中ta ...
- PHP获取当前服务器信息的基本语句
下面是PHP获取当前服务器信息的基本语句. PHP程式版本: <?PHP echo PHP_VERSION; ?> ZEND版本: <?PHP echo zend_version() ...
- C# 获取 mp3文件信息
C# 获取 mp3文件信息[包括:文件大小.歌曲长度.歌手.专辑] 第一种方式:[代码已验证] // http://bbs.csdn.net/topics/390392612 string fil ...
- Linux sysinfo获取系统相关信息
Linux中,可以用sysinfo来获取系统相关信息. #include <stdio.h> #include <stdlib.h> #include <errno.h& ...
- android播放器如何获取音乐文件信息
转http://blog.csdn.net/hellofeiya/article/details/8464356, android自带的音乐播放器中,在获取音乐文件信息的时候是通过扫描得到相关信息的. ...
- Android 动态获取ListView的高度
public static void setListViewHeightBasedOnChildren(ListView listView) { ListAdapter listAdapter = l ...
随机推荐
- 使用Maven Profile实现多环境构建
在开发过程中,我们的软件会面对不同的运行环境,比如开发环境.测试环境.生产环境,而我们的软件在不同的环境中,有的配置可能会不一样,比如数据源配置.日志文件配置.以及一些软件运行过程中的基本配置,那每次 ...
- Django的列表反序
Django虽然是python的web框架,但它不是所有的python特性都支持的. 最近在项目中遇到一个问题,需要在Django中将获得的列表反序排列,一开始我使用的是python的reverse方 ...
- System.FormatException: Index (zero based) must be greater than or equal to zero and less than the size of the argument list
static void Main(string[] args) { StringBuilder sb = new StringBuilder(); string test = "124454 ...
- Maven实战
一.不要重复造轮子 极限编程(XP)是近些年在软件行业红的发紫的敏捷开发方法,强调拥抱变化. Maven帮助XP团队实现一些核心价值: 1.简单.Maven暴露了一组一致.简洁的操 ...
- PLSQL_性能优化工具系列09_SQL Plan Management
2014-09-24 Created By BaoXinjian
- HDU 2087 剪花布条(KMP,不可重叠重复子串)
给KMP传的数组一定要从0开始!! 显然,我们要先把模式串放到前面,之后主串放后面,中间隔开,这样就可以根据前缀数组的性质来求了. 这题和我上一篇博客类似,只不过不可重叠,我看了数据范围不大,所以就开 ...
- ADO.NET(完整修改和查询、实体类,数据访问类)
一.完整修改和查询 在编写c#语句时需考虑到用户体验,例如在编写修改语句时,需要考虑到输入的内容在数据库中是否能够找到. 中间变量运用. 1.先查 2.执行操作 完整修改语句: bool has = ...
- Logs
syslogs Fortinet: http://docs.fortinet.com/fgt.html
- DataGridView操作
C# DataGridView控件动态添加新行 DataGridView控件在实际应用中非常实用,特别需要表格显示数据时.可以静态绑定数据源,这样就自动为DataGridView控件添加相应的行.假如 ...
- 前端实现 SVG 转 PNG
http://fex.baidu.com/blog/2015/11/convert-svg-to-png-at-frontend/ 前言 svg 是一种矢量图形,在 web 上应用很广泛,但是很多时候 ...