Windows 10 自动热键:在Windows 10中检测任务切换程序窗口
由于从Windows 7切换到Windows 10,以下操作不再有效:Windows 10 自动热键:在Windows 10中检测任务切换程序窗口,windows-10,autohotkey,Windows 10,Autohotkey,由于从Windows 7切换到Windows 10,以下操作不再有效: #IfWinActive ahk_class TaskSwitcherWnd ;; (Hotkeys that should only be active when the task switcher window is active) #If 显然,任务切换器不再是一个窗口,它也不会在上的DetectThiddenWindows中被检测到 有没有办法在windows 10中检测任务切换程序?目前我有以下解决方法: #If
#IfWinActive ahk_class TaskSwitcherWnd
;; (Hotkeys that should only be active when the task switcher window is active)
#If
显然,任务切换器不再是一个窗口,它也不会在上的DetectThiddenWindows中被检测到
有没有办法在windows 10中检测任务切换程序?目前我有以下解决方法:
#IfWinActive ahk_class TaskSwitcherWnd
;; (Hotkeys that should only be active when the task switcher window is active)
; Workaround for Windows 10
#If RegExMatch( A_OSVersion, "^10\." )
~^!Tab::varTaskSwitcherActive := true
#If varTaskSwitcherActive
~Esc::
~Enter::
~NumpadEnter::
~Space::
~LButton::
~MButton::
~RButton::
varTaskSwitcherActive := false
return
;; (Hotkeys that should only be active when the task switcher window is active)
#If
→ 说明:
- 如果OS版本变量与Windows 10匹配,那么我在AltGr+选项卡上设置了一个变量
- 如果设置了该变量,则可以执行热键
- 此外,如果设置了变量,并且按下了导致任务切换程序消失的任何键,则该变量将重置
问题是任务切换程序可能会因为其他事件而消失。
此外,我不确定这些是否是导致任务切换程序消失的所有键。在Windows 10上,其标题是任务切换、类多任务视图框架和进程资源管理器.exe
我也不需要设置隐藏窗口检测来检测它。简短回答
我唯一可以使用的ID是类和唯一ID的组合
#IfWinActive ahk_class Windows.UI.Core.CoreWindow ahk_exe Explorer.EXE
我通过激活AHK的WindowSpy并在任务视图打开时眯着眼睛来发现它们
这与“开始”菜单搜索、文件资源管理器或我测试过的其他系统上下文没有冲突
导航任务视图的有用方法
下面的内容并不直接相关,但是在Task View和AHK上没有太多的帖子,所以这里的内容可能会有所帮助
我将此ID用于上下文相关热键,以便在任务切换程序中导航,而无需移动手(h、j、k、l而不是箭头键)和打开或关闭窗口。如果您感到好奇,以下是脚本:
F4::
run, "C:\Users\Default\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\Window Switcher.lnk"
; this was originally written for Win 8.1, but it still works in Win 10 despite the
; shortcut being invisible in File Explorer
return
#IfWinActive ahk_class Windows.UI.Core.CoreWindow ahk_exe Explorer.EXE
l::Send, {Right}
h::Send, {Left}
j::Send, {Down}
k::Send, {Up}
o::Enter
x::Delete
return
我将它与用于切换到最新的窗口,而无需任何GUI启动(我尝试过的更简单的AHK解决方案出现故障,我忽略了此脚本的菜单部分)。任务视图非常好,但通常您只需进入最后一个窗口,不必大惊小怪。就这样,谢谢!知道为什么Window Spy没有检测到它吗?