博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
autoit3——打开窗口
阅读量:4050 次
发布时间:2019-05-25

本文共 1115 字,大约阅读时间需要 3 分钟。

利用AccExplorer.exe来打开选定的窗口

$Dis_Window_title:窗口名

Func Select_window_Dialog($Dis_Window_title)

    ;select one window in AccExplorer
    WinActivate($Dis_Window_title)
   
;判断当前AccExplorer是否已运行,如果在运行,则停止该程序
    While ProcessExists("AccExplorer.exe")
        ProcessClose("AccExplorer.exe")
    WEnd
    Sleep(10)
   
;运行AccExplorer程序,并最大化

    Run("AccExplorer.exe","",@SW_MAXIMIZE)

    ;如果出现错误,则关闭AccExplorer,等待一段时间后再重新打开该程序

    While @error
        If ProcessExists("AccExplorer.exe")Then
            ProcessClose("AccExplorer.exe")
        EndIf
        Sleep(500)
        Run($AccPath & "AccExplorer.exe","",@SW_MAXIMIZE)

    WEnd

   ;如果一定时间内没有启动AccExplorer程序,则把信息写入log中

    If not WinWaitActive($AccExplorerWindow,"",10)Then
        ;_FileWriteLog($LogPath & "\" & $LogName, "{Open the AccExplorer.exe timeout.}   " & "[Error]", -1)
        Return 0

    EndIf

   ;此时保证AccExplorer已经运行,并最大化,然后通过其菜单,打开选择窗口

    Sleep(800)
    Send("!o")   ;打开菜单项Options
    Sleep(800)
    Send("c")   ;选择choose window from list
    Sleep(800)
    Send($Dis_Window_title)   ;输入要打开的window
    Sleep(5000)
    Send("{Enter}") ;按回车键
    Sleep(8000)
    
    ;While Not StringInStr(ControlGetText ($AccExplorerWindow,"",$StatusBar),"Built hierarchy")
    ;WEnd
   
;展开该窗口列表   
    Sleep(5000)
    Send("+x")
    Sleep(5000)
    Return 1
EndFunc

转载地址:http://lkjci.baihongyu.com/

你可能感兴趣的文章
android中shader的使用
查看>>
java LinkedList与ArrayList迭代器遍历和for遍历对比
查看>>
drat中构造方法
查看>>
JavaScript的一些基础-数据类型
查看>>
JavaScript基础知识(2)
查看>>
转载一个webview开车指南以及实际项目中的使用
查看>>
android中对于非属性动画的整理
查看>>
一个简单的TabLayout的使用
查看>>
ReactNative使用Redux例子
查看>>
Promise的基本使用
查看>>
coursesa课程 Python 3 programming 统计文件有多少单词
查看>>
coursesa课程 Python 3 programming 输出每一行句子的第三个单词
查看>>
Returning a value from a function
查看>>
coursesa课程 Python 3 programming Functions can call other functions 函数调用另一个函数
查看>>
coursesa课程 Python 3 programming The while Statement
查看>>
course_2_assessment_6
查看>>
coursesa课程 Python 3 programming course_2_assessment_7 多参数函数练习题
查看>>
coursesa课程 Python 3 programming course_2_assessment_8 sorted练习题
查看>>
在unity中建立最小的shader(Minimal Shader)
查看>>
1.3 Debugging of Shaders (调试着色器)
查看>>