如何判断是否主音量静音? [英] How do I tell if the master volume is muted?

查看:201
本文介绍了如何判断是否主音量静音?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用下面的静音/取消静音我的电脑上的主音频。现在,我正在寻找一种方法来确定的静音状态。是否有一个同样简单的方式在C#中做到这一点。



 私人const int的APPCOMMAND_VOLUME_MUTE = 0x80000?; 
私人const int的WM_APPCOMMAND = 0x319;
函数[DllImport(user32.dll中)]
公共静态外部的IntPtr SendMessageW(IntPtr的的HWND,诠释消息,IntPtr的的wParam,lParam的IntPtr的);


解决方案

感谢RRUZ在上述评论。见stackoverflow.com/questions/294292。唯一的问题是,你需要兼容模式。


I am using the following to mute/unmute the master audio on my computer. Now, I am looking for a way to determine the mute state. Is there a just as easy way to do this in C#?

    private const int APPCOMMAND_VOLUME_MUTE = 0x80000;
    private const int WM_APPCOMMAND = 0x319;
    [DllImport("user32.dll")]
    public static extern IntPtr SendMessageW(IntPtr hWnd, int Msg, IntPtr wParam, IntPtr lParam);

解决方案

Credit to RRUZ in comments above. See stackoverflow.com/questions/294292. The only problem is that you need compatibility mode.

这篇关于如何判断是否主音量静音?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆