English 中文(简体)
Autohotkeey: 获取带有特定标题的窗口列表
原标题:Autohotkey: get list of windows with a certain title
  • 时间:2012-05-24 15:07:15
  •  标签:
  • autohotkey

我正在制作一个自动Hotkey脚本, 当带有某个标题或类 ID 的窗口出现时, 该脚本会在其内部绘制一个区域 。 问题在于有时多个这样的窗口会出现, 都具有相同的标题和类 ID 。 在这种情况下, 我的脚本无法检测它们全部, 只能在活动窗口中绘制一个区域 。

能否通过 AHK 中的所有窗口获得所有窗口的控点列表, 与标题或类 ID 匹配, 或者以某种其他方式通过 AHK 中的所有窗口循环?

最佳回答

winGet list 命令将产生一系列控点

Winget, id, 列表, MyTitle 然后环绕它们, 处理...

从帮助文件 :

; Example #2: This will visit all windows on the entire system and display info about each of them:
WinGet, id, list,,, Program Manager
Loop, %id%
{
    this_id := id%A_Index%
    WinActivate, ahk_id %this_id%
    WinGetClass, this_class, ahk_id %this_id%
    WinGetTitle, this_title, ahk_id %this_id%
    MsgBox, 4, , Visiting All Windows`n%a_index% of %id%`nahk_id %this_id%`nahk_class %this_class%`n%this_title%`n`nContinue?
    IfMsgBox, NO, break
}
问题回答

暂无回答




相关问题
How do you control a .NET checkbox from AutoHotKey?

I have a .NET application that contains a checkbox (System.Windows.Forms.Checkbox). This component (WindowsForms10.BUTTON.app.0.378734a1) is not directly controllable in AutoHotKEy using "Control,...

How can I rename my visual studio taskbar button?

I often work with multiple checkouts of the same solution, but as they all have the same name, all the taskbar buttons appear the same. I would like to rename the taskbar buttons so I can identify ...

Run AutoHotkey script when screen locked?

I ve written a couple of scripts with AutoHotkey, but I notice they only work when a user is logged in and the screen isn t locked. I d like to schedule the script to run. Does anyone know if that ...

AutoHotKey key SEQUENCE, not just single-key hotkey

I m not stupid... really. How do you map a key SEQUENCE (ie: Ctrl + Q , F) in AutoHotKey. I ve got Ctrl + Q down: ^q:: I ve even got F: f:: The examples in the help files even show how to do two ...

Where is the source code for AutoScriptWriter

I am using autohotkey for test now but tired with modifying the "Sleep, 100" generated by autoscriptwriter. So I decided to get the source code and see if I can modify it a little bit to fit my needs ...

Holding down the left mouse button in AutoHotkey

I want a script where pressing F1 makes AutoHotkey hold down the left mouse button. I then want the script to release the mouse once I press the key again. How can I do that?

热门标签