/// <summary>
/// 音量调节
/// </summary>
/// <param></param>
/// <returns></returns>
private void Slids_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
//Slider滑动控制
var da = (int)(Slids.Value * 10);
SistemVolumChanger.SetVolume(da);
}
#region 音量控制
static class NativeMethods
{
[DllImport("winmm.dll", EntryPoint = "waveOutSetVolume")]
public static extern int WaveOutSetVolume(IntPtr hwo, uint dwVolume);
[DllImport("winmm.dll", SetLastError = true)]
public static extern bool PlaySound(string pszSound, IntPtr hmod, uint fdwSound);
}
public static class MSWindowsFriendlyNames
{
WPF 音量调节
最新推荐文章于 2023-05-11 22:04:56 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)