在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
public FrmVoice() { InitializeComponent(); } [DllImport("user32.dll", EntryPoint = "SendMessageA")] public static extern int SendMessage(IntPtr handle, int wMsg, int wParam, int lParam); private const int WM_APPCOMMAND = 0x319; private const int APPCOMMAND_VOLUME_UP = 10; private const int APPCOMMAND_VOLUME_DOWN = 9; private const int APPCOMMAND_VOLUME_MUTE = 8; private void buttonVoiceUp_Click(object sender, EventArgs e) { SendMessage(Handle, WM_APPCOMMAND, 0x30292, APPCOMMAND_VOLUME_UP * 0x10000); } private void buttonVoiceDown_Click(object sender, EventArgs e) { SendMessage(Handle, WM_APPCOMMAND, 0x30292, APPCOMMAND_VOLUME_DOWN * 0x10000); } private void buttonMute_Click(object sender, EventArgs e) { SendMessage(Handle, WM_APPCOMMAND, 0x200EB0, APPCOMMAND_VOLUME_MUTE * 0x10000); } protected override void WndProc(ref Message m)//监视Windows消息 { const int WM_APPCOMMAND = 0x319; switch (m.Msg) { //case WM_APPCOMMAND: // { // MessageBox.Show(m.ToString()); // } // break; } base.WndProc(ref m); //将系统消息传递自父类的WndProc }
|
请发表评论