locked
How To Mute Just Windows System (Sounds)? RRS feed

  • Question

  • I'm trying to mute windows system (SOUNDS) in the mixer there is an option that says (WINDOWS SOUNDS) I want to mute that with a button.....

    Thanks in advanced....
    • Edited by Tj.. _ Wednesday, June 24, 2009 5:43 AM
    • Changed type Tj.. _ Wednesday, June 24, 2009 5:43 AM
    Wednesday, June 24, 2009 12:18 AM

All replies

    • Proposed as answer by Harry Zhu Wednesday, July 1, 2009 9:06 AM
    • Marked as answer by Harry Zhu Wednesday, July 1, 2009 9:08 AM
    • Unmarked as answer by Tj.. _ Friday, January 29, 2010 5:13 PM
    • Unproposed as answer by Tj.. _ Friday, January 29, 2010 5:14 PM
    Wednesday, June 24, 2009 12:23 AM
  • I dont want to mute the master volume just the (WINDOWS SOUNDS)...
    Wednesday, June 24, 2009 12:24 AM
  • That one was in C++ anyways. 

    Try this:

    http://www.codeguru.com/csharp/csharp/cs_graphics/sound/article.php/c10931

    Sorry to simply post links on this, but there does seem to be a good amount of info out there on the web.  This link is in C#, and seems to have more granularity than the other.

    Keep in mind, however, that not every mixer has the (WINDOWS SOUNDS) mixer.  This may be specific to your particular sound card or driver. 

    Finally, if that doesn't work, you can always set this up using the registry.  Here's how.

    In the Windows Registry, all the system sounds are stored under HKEY_CURRENT_USER\AppEvents\Schemes\Apps

    Now, under Apps are several folders, and under each of those folders are more folders, and lastly, under each one of those (that is, the great grandchildren of Apps), is another folder, called ".Current". This folder's default value is what is used by the system. 

    To turn off a system sound, simply set the value of all the .Current folders to an empty string.  The sounds will no longer play.

    Now, you'll probably want to save the user's original settings, because changing these values could probably tick off a user pretty badly. 
    David Morton - http://blog.davemorton.net/ - @davidmmorton - ForumsBrowser, a WPF MSDN Forums Client
    • Marked as answer by Harry Zhu Wednesday, July 1, 2009 9:08 AM
    • Unmarked as answer by Tj.. _ Monday, December 21, 2009 3:27 AM
    • Proposed as answer by Jonas Hörmann Monday, May 16, 2016 9:09 PM
    Wednesday, June 24, 2009 12:45 AM
  • There has got to be a way to mute just the windows sounds ..... Thanks in advanced
    Wednesday, June 24, 2009 5:41 AM
  • There has got to be a way to mute just the windows sounds ..... Thanks in advanced

    Did you miss the post by David M Morton?
    Wednesday, June 24, 2009 9:35 AM
  • How do you set the value of all the .Current folders to an empty string then
    restore them...
    Wednesday, June 24, 2009 11:41 AM
  • Hi,

    Have you tried to open the Register Editor and check the item?
    Please have a try.

    Harry
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Proposed as answer by Renato Virto Wednesday, February 29, 2012 6:35 PM
    Wednesday, July 1, 2009 9:11 AM
    1. go to the bottom right corner of your screen and click on the icon that looks like a speaker
    2. Click on Mixer  
    3. and then you can mute whatever you want 
    Wednesday, February 29, 2012 6:41 PM
  • I know it's an old question, but for all people out there searching for solutions, here is not the best, but a working one.

    I am sending a mouse click to the handle of the Windows Volume Mixer (I am using the Coordinates working for Win10) to click at the mute button of the system sounds.

    static bool isStarted = false;
    
            [DllImport("user32.dll")]
            [return: MarshalAs(UnmanagedType.Bool)]
            static extern bool SetForegroundWindow(IntPtr hWnd);
    
    
            public static void MuteSystemSounds()
            {
                if (isStarted == false)
                {
                    Process.Start("SndVol.exe");
                    Thread.Sleep(2000);
                    isStarted = true;
                }
                Process[] ps = Process.GetProcessesByName("SndVol");
                if (ps[0] != null)
                {                
                    SetForegroundWindow(ps[0].MainWindowHandle);
                    ClickOnPointTool.ClickOnPoint(ps[0].MainWindowHandle, new Point(180, 250));
                }
            }

    For Win8 and lower you will have to change the coords of the Point, I think.

    P.S. This is the class used to send the MouseClick

    public class ClickOnPointTool
            {
    
                [DllImport("user32.dll")]
                static extern bool ClientToScreen(IntPtr hWnd, ref Point lpPoint);
    
                [DllImport("user32.dll")]
                internal static extern uint SendInput(uint nInputs, [MarshalAs(UnmanagedType.LPArray), In] INPUT[] pInputs, int cbSize);
    
    #pragma warning disable 649
                internal struct INPUT
                {
                    public UInt32 Type;
                    public MOUSEKEYBDHARDWAREINPUT Data;
                }
    
                [StructLayout(LayoutKind.Explicit)]
                internal struct MOUSEKEYBDHARDWAREINPUT
                {
                    [FieldOffset(0)]
                    public MOUSEINPUT Mouse;
                }
    
                internal struct MOUSEINPUT
                {
                    public Int32 X;
                    public Int32 Y;
                    public UInt32 MouseData;
                    public UInt32 Flags;
                    public UInt32 Time;
                    public IntPtr ExtraInfo;
                }
    
    #pragma warning restore 649
    
    
                public static void ClickOnPoint(IntPtr wndHandle, Point clientPoint)
                {
                    var oldPos = Cursor.Position;
    
                    /// get screen coordinates
                    ClientToScreen(wndHandle, ref clientPoint);
    
                    /// set cursor on coords, and press mouse
                    Cursor.Position = new Point(clientPoint.X, clientPoint.Y);
    
                    var inputMouseDown = new INPUT();
                    inputMouseDown.Type = 0; /// input type mouse
                    inputMouseDown.Data.Mouse.Flags = 0x0002; /// left button down
    
                    var inputMouseUp = new INPUT();
                    inputMouseUp.Type = 0; /// input type mouse
                    inputMouseUp.Data.Mouse.Flags = 0x0004; /// left button up
    
                    var inputs = new INPUT[] { inputMouseDown, inputMouseUp };
                    SendInput((uint)inputs.Length, inputs, Marshal.SizeOf(typeof(INPUT)));
    
                    /// return mouse 
                    Cursor.Position = oldPos;
                }
    
            }



    Monday, May 16, 2016 9:06 PM