The following is that.
va.ahk https://autohotkey.com/board/topic/21984-vista-audio-control-functions/
Code: Select all
#Include va.ahk
WinGet, winpid, pid, % "ahk_exe msedge.exe"
MsgBox, % GetAppVolume(winpid)
Sleep, 1000
exitapp
; set the master volume about the window
; vol is 0-100, can be signed
setWndVol(vol, winTitle := "a"){
winGet, winPid, PID, % winTitle
if !(volume := GetVolumeObject(winPid))
return
vsign := subStr(vol, 1, 1)
if (vsign = "+" || vsign = "-") {
vol := subStr(vol, 2)
VA_ISimpleAudioVolume_GetMasterVolume(volume, cvol)
cvol *= 100
vol := Round(cvol + vol)
if(vol > 100)
vol := 100
}
VA_ISimpleAudioVolume_SetMasterVolume(volume, vol / 100)
objRelease(volume)
}
; return master volume about the window
; return 0-100
getWndVol(winTitle := "a"){
winGet, winPid, PID, % winTitle
if(!volume := GetVolumeObject(winPid))
return
VA_ISimpleAudioVolume_GetMasterVolume(volume, cvol)
objRelease(volume)
return Round(cvol * 100)
}
I guess the reason why the edge manages many complex sub processes.
On the other hand, the volume mixer panel of Windows could control the volume of edge properly.
How can I treat volumes like the volume mixer panel..?
Thanks in advance for your help.