任何人都知道如何使用C#以编程方式静音Windows XP卷?
为P/Invoke声明这个:
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);
然后使用此线来静音/取消静音.
SendMessageW(this.Handle, WM_APPCOMMAND, this.Handle, (IntPtr) APPCOMMAND_VOLUME_MUTE);