码迷,mamicode.com
首页 > Windows程序 > 详细

winform程序静音

时间:2014-06-09 17:12:04      阅读:341      评论:0      收藏:0      [点我收藏+]

标签:winform   c   a   tar   ext   int   

using System.Runtime.InteropServices;    //命名空间

const uint WM_APPCOMMAND = 0x319;
const uint APPCOMMAND_VOLUME_UP = 0x0a;
const uint APPCOMMAND_VOLUME_DOWN = 0x09;
const uint APPCOMMAND_VOLUME_MUTE = 0x08;

[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, uint wParam, uint lParam);

 

 

private void music_Click(object sender, EventArgs e)
{
SendMessage(this.Handle, WM_APPCOMMAND, 0x200eb0, APPCOMMAND_VOLUME_MUTE * 0x10000);
}

winform程序静音,布布扣,bubuko.com

winform程序静音

标签:winform   c   a   tar   ext   int   

原文地址:http://www.cnblogs.com/FLWL/p/3777625.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!