; ; Current volume of full-screen application ; Value between 0 (muted) and 1 (100%) ; currentAppVolume := 1 ; ; Toggle
;
; Current volume of full-screen application
; Value between 0 (muted) and 1 (100%)
;
currentAppVolume := 1
;
; Toggle full-screen app volume
;
$NumpadMult::
if (isActiveWindowFullScreen()) {
if (currentAppVolume < 1) {
setAppVolume(1)
} else {
setAppVolume(0.3)
}
} else {
Send {NumpadMult down}
}
return
;
; Increase full-screen app volume
;
$NumpadAdd::
if (isActiveWindowFullScreen()) {
setAppVolume(currentAppVolume + 0.1)
} else {
Send {NumpadAdd down}
}
return
;
; Decrease full-screen app volume
;
$NumpadSub::
if (isActiveWindowFullScreen()) {
setAppVolume(currentAppVolume - 0.1)
} else {
Send {NumpadSub down}
}
return
;
; Set volume of focused application
;
setAppVolume(volume) {
global currentAppVolume
if (volume > 1) {
volume := 1
} else if (volume < 0) {
volume := 0
} else {
volume := Round(volume, 2) + 0
}
Run, nircmd.exe setappvolume focused %volume%
currentAppVolume := volume
return
}
;
; Checks if active window is in full-screen
;
isActiveWindowFullScreen() {
winID := WinExist("A")
If (!winID)
return false
WinGet style, Style, ahk_id %winID%
WinGetPos ,,,winW,winH, "A"
; 0x800000 is WS_BORDER.
; 0x20000000 is WS_MINIMIZE.
; no border and not minimized
return ((style & 0x20800000) or winH < A_ScreenHeight or winW < A_ScreenWidth) ? false : true
}
使用方法自己专研吧!新手就免了,新手自己好好学学教程!
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。


可以再写一段,调节当前激活窗口的音量吗,不是总音量