分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 前端开发

WebKit.NET-0.5简单应用(2)——音量解决方案

发布时间:2023-09-06 01:33责任编辑:胡小海关键词:.NETWeb

查找WebKit.NET相关文档,没有找到音量控制解决方法。换思路进行解决,尝试用Win32 API进行解决

[DllImport("winmm.dll")]public static extern int waveOutSetVolume(IntPtr h, uint dwVolume);

试了试是可以调整音量的,全部代码如下

using System;using System.Collections.Generic;using System.Text;using System.Runtime.InteropServices;namespace VolumeControl{ ???public static class VolumeControl ???{ ???????public enum INTERNETFEATURELIST ???????{ ???????????FEATURE_OBJECT_CACHING = 0, ???????????FEATURE_ZONE_ELEVATION = 1, ???????????FEATURE_MIME_HANDLING = 2, ???????????FEATURE_MIME_SNIFFING = 3, ???????????FEATURE_WINDOW_RESTRICTIONS = 4, ???????????FEATURE_WEBOC_POPUPMANAGEMENT = 5, ???????????FEATURE_BEHAVIORS = 6, ???????????FEATURE_DISABLE_MK_PROTOCOL = 7, ???????????FEATURE_LOCALMACHINE_LOCKDOWN = 8, ???????????FEATURE_SECURITYBAND = 9, ???????????FEATURE_RESTRICT_ACTIVEXINSTALL = 10, ???????????FEATURE_VALIDATE_NAVIGATE_URL = 11, ???????????FEATURE_RESTRICT_FILEDOWNLOAD = 12, ???????????FEATURE_ADDON_MANAGEMENT = 13, ???????????FEATURE_PROTOCOL_LOCKDOWN = 14, ???????????FEATURE_HTTP_USERNAME_PASSWORD_DISABLE = 15, ???????????FEATURE_SAFE_BINDTOOBJECT = 16, ???????????FEATURE_UNC_SAVEDFILECHECK = 17, ???????????FEATURE_GET_URL_DOM_FILEPATH_UNENCODED = 18, ???????????FEATURE_TABBED_BROWSING = 19, ???????????FEATURE_SSLUX = 20, ???????????FEATURE_DISABLE_NAVIGATION_SOUNDS = 21, ???????????FEATURE_DISABLE_LEGACY_COMPRESSION = 22, ???????????FEATURE_FORCE_ADDR_AND_STATUS = 23, ???????????FEATURE_XMLHTTP = 24, ???????????FEATURE_DISABLE_TELNET_PROTOCOL = 25, ???????????FEATURE_FEEDS = 26, ???????????FEATURE_BLOCK_INPUT_PROMPTS = 27, ???????????FEATURE_ENTRY_COUNT = 28 ???????} ???????private const int SET_FEATURE_ON_THREAD = 0x00000001; ???????private const int SET_FEATURE_ON_PROCESS = 0x00000002; ???????private const int SET_FEATURE_IN_REGISTRY = 0x00000004; ???????private const int SET_FEATURE_ON_THREAD_LOCALMACHINE = 0x00000008; ???????private const int SET_FEATURE_ON_THREAD_INTRANET = 0x00000010; ???????private const int SET_FEATURE_ON_THREAD_TRUSTED = 0x00000020; ???????private const int SET_FEATURE_ON_THREAD_INTERNET = 0x00000040; ???????private const int SET_FEATURE_ON_THREAD_RESTRICTED = 0x00000080; ???????[DllImport("urlmon.dll")] ???????[PreserveSig] ???????[return: MarshalAs(UnmanagedType.Error)] ???????public static extern int CoInternetSetFeatureEnabled( ????????????INTERNETFEATURELIST FeatureEntry, ????????????[MarshalAs(UnmanagedType.U4)] int dwFlags, ????????????bool fEnable); ???????[DllImport("winmm.dll")] ???????public static extern int waveOutGetVolume(IntPtr h, out uint dwVolume); ???????[DllImport("winmm.dll")] ???????public static extern int waveOutSetVolume(IntPtr h, uint dwVolume); ???}}

  

WebKit.NET-0.5简单应用(2)——音量解决方案

原文地址:https://www.cnblogs.com/leiyongbo/p/8159490.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved