通过Acc库控制窗口控件

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
#include %A_scriptdir%/lib/acc.ahk
global childPathPen := "4.10.1.1.3.1"
global childPathDele := "4.10.1.1.2.1.1"
F1::
obj := Acc_GetInfoUnderCursor(), id:=obj.hwnd
DetectHiddenWindows, On
WinGetTitle, tt, ahk_id %id%
WinGetClass, class, ahk_id %id%
tt:=Trim(class="" ? tt : tt " ahk_class " class)
;MsgBox, 4096,, % "id" id "-->" tt " --> " obj.path " --> " SubStr(obj.text,1,100)
return
f2::
choosebutton(childPathPen,id)
return
f3::
choosebutton(childPathDele,id)
return

choosebutton(childPath,id)
{
    local
    ;MsgBox,% "childPath:" childPath "id:" id 
    Acc := Acc_Get("Object",childPath, 0, "ahk_id" id)
    Acc.accDoDefaultAction(0)
}

f6::
Reload
return
;==================================================
;Acc:=Acc_Get("Object", obj.path, 0, "ahk_id " id)
;Acc.accSelect(1,0)
;MsgBox,% Acc.accValue(0)
;SendInput, {raw}{hetong}
;Acc.put_accValue(0,"value")
;Acc.accDoDefaultAction(0)
最后修改: 2020-10-13 08:14

人已赞赏
AHKV1系统

有时候要输入cmd命令结束程序,用ahk点击粘贴命令。

2020-6-4 22:00:25

AHKV1学习

AHK 终端类【搬运】

2020-7-13 16:58:15

2 条回复 A文章作者 M管理员
  1. 测试缺少函数,com库加上后,acc库里也没有你用的函数。。。

个人中心
今日签到
有新私信 私信列表
搜索