国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

C# 控制系統音量,靜音 (加減按鈕形式)

2019-11-17 04:07:47
字體:
來源:轉載
供稿:網友
view plaincopy to clipboardPRint?
·········10········20········30········40········50········60········70········80········90········100·······110·······120·······130·······140·······150
using System;   
using System.Collections.Generic;   
using System.ComponentModel;   
using System.Data;   
using System.Drawing;   
using System.Text;   
using System.Windows.Forms;   
    
using System.Runtime.InteropServices;   
  
namespace VolumnSet   
{   
    public partial class Form1 : Form   
    {   
  
    
  
        [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]   
        static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, uint wParam, uint lParam);   
        const uint WM_APPCOMMAND = 0x319;   
        const uint APPCOMMAND_VOLUME_UP = 0x0a;   
        const uint APPCOMMAND_VOLUME_DOWN = 0x09;   
        const uint APPCOMMAND_VOLUME_MUTE = 0x08;   
        public Form1()   
        {   
            InitializeComponent();   
  
        }   
        private void button1_Click(object sender, EventArgs e)   
        {   
  
             //加音量   
            SendMessage(this  
  .Handle, WM_APPCOMMAND, 0x30292, APPCOMMAND_VOLUME_UP * 0x10000);   
        }   
  
        private void button2_Click(object sender, EventArgs e)   
        {   
  
             //減音量   
            SendMessage(this.Handle, WM_APPCOMMAND, 0x30292, APPCOMMAND_VOLUME_DOWN * 0x10000);   
        }   
  
          
  
        private void checkBox1_CheckedChanged(object sender, EventArgs e)   
        {   
  
             //靜音   
            SendMessage(this.Handle, WM_APPCOMMAND, 0x200eb0, APPCOMMAND_VOLUME_MUTE * 0x10000);   
        }   
    }   
}  
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 吉林市| 黄冈市| 衡水市| 凤庆县| 吉木乃县| 丹江口市| 织金县| 石台县| 嘉峪关市| 连江县| 电白县| 四子王旗| 贞丰县| 光山县| 会昌县| 乌拉特前旗| 嘉善县| 河曲县| 视频| 忻城县| 白沙| 延津县| 格尔木市| 青阳县| 永康市| 广德县| 托克托县| 阳新县| 海盐县| 大宁县| 东乡| 原平市| 礼泉县| 德庆县| 阿巴嘎旗| 元谋县| 阜康市| 五大连池市| 资阳市| 克拉玛依市| 资中县|