|
你的图片看不到,不清楚你的需求是啥。
如果是要定位控件,可以试试ACC或者UIA,这两个都有v1和v2版本。
如果是controlget写法,可以参考以下code,v1版本的写法
- Explorer_GetSelection(hwnd="")
- {
- WinGet, process, processName, % "ahk_id" hwnd := hwnd? hwnd:WinExist("A")
- WinGetClass class, ahk_id %hwnd%
- if (process != "explorer.exe")
- return
- if (class ~= "Progman|WorkerW") {
- ControlGet, files, List, Selected Col1, SysListView321, ahk_class %class%
- Loop, Parse, files, `n, `r
- ToReturn .= A_Desktop "" A_LoopField "`n"
- } else if (class ~= "(Cabinet|Explore)WClass") {
- for window in ComObjCreate("Shell.Application").Windows
- {
- try{
- if (window.hwnd==hwnd)
- sel := window.Document.SelectedItems
- }catch e {
- continue
- }
- }
- for item in sel
- ToReturn .= item.path "`n"
- }
- return Trim(ToReturn,"`n")
- }
复制代码 |
|