Autohotkey 在带有多个监视器的任务栏上使用鼠标滚轮更改音量

Autohotkey 在带有多个监视器的任务栏上使用鼠标滚轮更改音量,autohotkey,Autohotkey,我使用下面的自动热键脚本,在Windows 10中将鼠标悬停在任务栏上时,可以使用鼠标滚轮更改音量。但是,这仅适用于选择为“主显示器”的显示器。我有多个用于扩展桌面的显示器。在扩展监视器任务栏上使用鼠标滚轮滚动不起作用 是否有方法修改脚本以使用扩展显示 SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensur

我使用下面的自动热键脚本,在Windows 10中将鼠标悬停在任务栏上时,可以使用鼠标滚轮更改音量。但是,这仅适用于选择为“主显示器”的显示器。我有多个用于扩展桌面的显示器。在扩展监视器任务栏上使用鼠标滚轮滚动不起作用

是否有方法修改脚本以使用扩展显示

SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.

;--------------------------------------------------------------------
; Change volume using mouse scroll wheel over taskbar
;--------------------------------------------------------------------

#if MouseIsOver("ahk_class Shell_TrayWnd")

WheelUp::
Send {Volume_Up}
return

WheelDown::
Send {Volume_Down}
return

MouseIsOver(WinTitle) {
    MouseGetPos,,, Win
    return WinExist(WinTitle . " ahk_id " . Win)
}
只有“主显示器”的桌面任务栏具有窗口类
Shell\u TrayWnd

辅助任务栏具有窗口类
Shell\u Secondary TrayWnd


我不熟悉AutoHotKey脚本的语法-所以我不能给你一个你可以复制+粘贴的答案-但是你需要更改
If
语句中的逻辑条件,以检查
mouseissover(“ahk_class Shell_TrayWnd”)**或**mouseissover(“ahk_class Shell_SecondaryTrayWnd”)

我不熟悉AutoHotKey脚本,关于
#if
的范围何时结束(不同于
if
(没有
#
)-你能重新发布你的脚本以使用
if
而不是
#if
?@Dai自动热键中的#if语句吗?事实上,我已经更新了我的评论回复。谢谢!将if语句更改为以下语句有效:
#if mouseishover(“ahk_class Shell_TrayWnd”)| mouseishover(“ahk_class Shell_secondary TrayWnd”)
@RyanBuening我很有用!