zoukankan      html  css  js  c++  java
  • AutoHotkey获取windows10新增的设置界面(ApplicationFrameHost.exe)相关信息

    用 AutoHotkey 通过 acc 方式获取上图的相关信息。

    值得注意的是 acc 不是用窗口的 hwnd, 而是从控件 Windows.UI.Core.CoreWindow1 的 hwnd 一层层获取的。

    相关文件下载

    AccViewer.exe 是查看窗口的工具,

    acc.ahk 是基础库,

    具体应用见 Applicationframehost.ahk

    msgbox(format("分类:{1}`n列表第2项:{2}`n标题:{3}`n子标题:{4}", _10.type(),_10.list()[2],_10.title(),_10.subTitle()))
    #include *i %A_LineFile%..acc.ahk
    
    #if WinActive("ahk_exe ApplicationFrameHost.exe")
    
    :O:eng::english(United States)
    return
    
    F4::
    _10.title()
    return
    
    #if
    
    class _10
    {
    
        accRoot(winTitle:="ahk_class ApplicationFrameWindow")
        {
            winId := ControlGetHwnd("Windows.UI.Core.CoreWindow1", winTitle) ;NOTE 不是主窗口,而是控件
            dllcall("LoadLibrary","Str","oleacc","Ptr")
            if dllcall("oleaccAccessibleObjectFromWindow", "ptr",winId, "uint",0, "ptr",-VarSetCapacity(IID,16)+NumPut(0x719B3800AA000C81,NumPut(0x11CF3C3D618736E0,IID,"int64"),"int64"), "ptr*",pacc)=0
                return ComObject(9,pacc,1)
        }
    
        ;分类(查找框下面第1行)
        type(winTitle:="ahk_class ApplicationFrameWindow")
        {
            return Acc_GetChildByPath(this.accRoot(winTitle), "4.4").accName(0)
        }
    
        ;左侧列表名称
        list(winTitle:="ahk_class ApplicationFrameWindow")
        {
            arr := []
            for _, accChild in Acc_Children(Acc_GetChildByPath(this.accRoot(winTitle), "4.5"))
                arr.push(accChild.accName(0))
            return arr
        }
    
        ;标题(右侧第1行)
        title(winTitle:="ahk_class ApplicationFrameWindow")
        {
            return Acc_GetChildByPath(this.accRoot(winTitle), "4.6.1").accName(0)
        }
    
        ;子标题(右侧第2行)
        subTitle(winTitle:="ahk_class ApplicationFrameWindow")
        {
            return Acc_GetChildByPath(this.accRoot(winTitle), "4.6.2.1.1").accName(0)
        }
    
    }
  • 相关阅读:
    net core 接入 Google Authenticator
    centos7 安装Mysql8.0笔记
    学习笔记: AOP面向切面编程和C#多种实现
    Exceptionless 生产部署笔记
    图片上下左右自适应对齐
    rem
    mysql command line client 使用命令
    文字溢出换行或者省略号
    一个自欺欺人的代码(便于理解函数和对象基础)
    this、new、模式工厂、创建新的构造函数
  • 原文地址:https://www.cnblogs.com/hyaray/p/12433985.html
Copyright © 2011-2022 走看看