应用全屏状态下调节其音量,来自网络

; 
; 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
}

 

使用方法自己专研吧!新手就免了,新手自己好好学学教程!

 

给TA捐赠
共{{data.count}}人
人已捐赠
其他教程

控制键,KeyWait以及系统字符重复的坑

2018-4-22 7:50:48

其他

文本交互替换

2018-4-26 16:56:53

2 条回复 A文章作者 M管理员
  1. ainiau

    ?

  2. 咦,有大神!

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

个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索