Jump to content

mute the sound of specific window


Recommended Posts

$ProgramToMute = "chrome"
$hWnd = WinGetHandle("Volume Mixer", "")
$close =False
If Not HWnd($hWnd) Then
    Run("sndvol.exe", "", @SW_HIDE)
    $hWnd = WinWaitActive("Volume Mixer")
    $close = True
EndIf
$i = 0
Do
    $i += 1
    If StringInStr(ControlGetText($hWnd, "", "[CLASS:ToolbarWindow32; INSTANCE:" & $i & "]"), $ProgramToMute) Then
        ControlClick($hWnd, "", "ToolbarWindow32" & $i, "", 1)
        ExitLoop
    EndIf
Until Not HWnd(ControlGetHandle($hWnd, "", "[CLASS:ToolbarWindow32; INSTANCE:" & $i & "]"))
If $close Then WinClose($hWnd, "")

;)

Edited by Deye
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...