33 lines
845 B
C#
33 lines
845 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
namespace ryCommon
|
|
{
|
|
/// <summary>
|
|
/// 系统音量操作类
|
|
/// </summary>
|
|
public class RySysSound
|
|
{
|
|
/// <summary>
|
|
/// 判断系统是否正处于静音
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public static bool IsMute()
|
|
{
|
|
var osversion = Environment.OSVersion;
|
|
if(osversion.Version.Major<6 || (osversion.Version.Major== 6 && osversion.Version.Minor==0))
|
|
{
|
|
var mi = SoundControl_XP.GetMixerControls();
|
|
return SoundControl_XP.IsMuted(mi);
|
|
}
|
|
else
|
|
{
|
|
var mi = SoundControl.GetMixerControls();
|
|
return SoundControl.IsMuted(mi);
|
|
}
|
|
}
|
|
}
|
|
}
|