I am learning C# and WPF and had an idea for a little utility. I want a big red button that will do only one thing: completely mute/un-mute all Windows sounds (system beeps, WMP, DVD player, etc...) I've explored the object browser in VS 2008 but can't seem to find what I need: A mute that will affect all of Windows.
Is it System.Windows.Input.MediaCommands.MuteVolume
and I'm just not getting how to use it?
Thanks for any pointers in the right direction using C# and/or WPF. :)
I'm pretty sure that command is used by the individual WPF controls for muting. For instance, if the CommandTarget were a MediaElement, it would mute its sound when that command was executed. Unfortunately, I think you're going to have to do a bit more work. A quick google gave some examples for doing the p/invoke way, which is probably the only way to do it as of now in .NET:
For XP: MSDN
For Vista/7: CodeProject
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With