#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的信息的更多相关文章

  1. android利用ContentResolver访问者获取手机联系人信息

    转载自:http://www.jb51.net/article/106379.htm 首先需要在AndroidManifest.xml文件中添加权限: <uses-permission andr ...

  2. sql 2012中获取表的信息,包含字段的描述

    1.获取数据库中的表 select name from sysobjects where type='U' 2.获取表字段(此处是Route表) Select name from syscolumns ...

  3. ThinPHP命名空间,连接数据库是要修改的配置文件,Model数据模型层,跨控制器调用,如何获取系统常量信息,

    一.命名空间(主要是为了实现自动加载类) *命名空间(相当于虚拟的目录),为了让类有一个统一的文件夹来管理(可以自动加载'类'),每个文件都要有命名空间*tp如何做命名空间:*TP框架下有一个初始命名 ...

  4. 获取应用程序信息.h

    ////  获取应用程序信息.h//  IOS笔记// 一般会用来判断是否有新版本.是否需要强制更新 iOS的版本号,一个叫做Version,一个叫做Build,这两个值都可以在Xcode 中选中ta ...

  5. PHP获取当前服务器信息的基本语句

    下面是PHP获取当前服务器信息的基本语句. PHP程式版本: <?PHP echo PHP_VERSION; ?> ZEND版本: <?PHP echo zend_version() ...

  6. C# 获取 mp3文件信息

    C# 获取 mp3文件信息[包括:文件大小.歌曲长度.歌手.专辑] 第一种方式:[代码已验证] // http://bbs.csdn.net/topics/390392612   string fil ...

  7. Linux sysinfo获取系统相关信息

    Linux中,可以用sysinfo来获取系统相关信息. #include <stdio.h> #include <stdlib.h> #include <errno.h& ...

  8. android播放器如何获取音乐文件信息

    转http://blog.csdn.net/hellofeiya/article/details/8464356, android自带的音乐播放器中,在获取音乐文件信息的时候是通过扫描得到相关信息的. ...

  9. Android 动态获取ListView的高度

    public static void setListViewHeightBasedOnChildren(ListView listView) { ListAdapter listAdapter = l ...

随机推荐

  1. php 根据指定的键对多维数组进行排序

    根据指定的键对多维数组排序,可以按照多个键排序 我们通常有一些多维数组需要排序: $guys = array( array( 'name' => 'jake', 'score' => 80 ...

  2. Linux下dig命令使用

    Dig简介:   Dig是一个在类Unix命令行模式下查询DNS包括NS记录,A记录,MX记录等相关信息的工具.由于一直缺失Dig man page文档,本文就权当一个dig使用向导吧.   Dig的 ...

  3. 204. Count Primes

    Description: Count the number of prime numbers less than a non-negative number, n. ============= 找质数 ...

  4. 黄聪:PHP 防护XSS,SQL,代码执行,文件包含等多种高危漏洞

    版本:v1.1更新时间:2013-05-25更新内容:优化性能功能说明: 可以有效防护XSS,sql注射,代码执行,文件包含等多种高危漏洞. 使用方法: 将waf.php传到要包含的文件的目录 在页面 ...

  5. Eclipse中Maven+Spring3.2.8+SpringMVC HelloWorld项目

    本文适合有一定spring和springmvc基础,并想使用Maven管理项目的人. 源码打包:http://pan.baidu.com/s/1hqurUcs 转载请声明出处(http://www.c ...

  6. MVC controller and View

    actionresult,jsonresult redirectresult partialview, viewdata, tempdata filter viewdata,只能在当前action中有 ...

  7. Javascript生成GUID

    GUID(全球唯一标识)是微软使用的一个术语,由一个特定的算法,给某一个实体,如Word文档,创建一个唯一的标识,GUID值就是这个唯一的标识码.除了.Net有专门的方法生成外,JS也可以生成GUID ...

  8. java泛型的使用

    package com.wzh.test.generic; import java.util.ArrayList; import java.util.HashMap; import java.util ...

  9. ubuntu14.04 wifi频繁掉线解决

    uname -r sudo lspci -knn sudo lshw -numeric -class network sudo ifconfig -a sudo route -nv sudo rfki ...

  10. TRUNCATE与 DELETE

    源地址:http://zhidao.baidu.com/link?url=9zB64BuXiAXNPF-zxvd6VLGTKb2FsUzQ-FsRAeQaYzycOGT5uGPXb-oB44TuYoP ...