主音量是静音还是静音?! [英] Master volume is mute or is unmute?!
本文介绍了主音量是静音还是静音?!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在C#编程中检查主音量是静音还是静音?
我有这段代码:
How i can check master volume is mute or is unmute in C# programming??
I have this code:
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);
但它没有给我音量状态。这段代码只是改变状态。
Tnx
but it does not give me volume status. this code just change the status.
Tnx
推荐答案
你可以使用
来完成一些复杂的代码
You can do it with some complicated code using
[DllImport("winmm.dll")]
public static extern int mixerGetControlDetails(IntPtr hmxobj,ref MIXERCONTROLDETAILS pmxcd, MIXER_GETCONTROLDETAILSFLAG fdwDetailsmixer);
最佳选择是获取Gustavo Franco的WaveLibMixer代码,例如来自
http://volumehotkey.googlecode.com/svn-history/ r2 / trunk / WaveLibMixer / [ ^ ]
在这里发帖子这个帖子:
vb.net - 如何检查主音量是否静音 - Stack Overflow [ ^ ]
您可以轻松地将代码从vb转换为c#。
chek this post here:
vb.net - how to check the master volume is muted or not - Stack Overflow[^]
you can easily convert code from vb to c#.
这篇关于主音量是静音还是静音?!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文