WebBrowser Mute (Refresh, click on the sound of the webpage) (including Flash mute)

Source: Internet
Author: User

  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_protoc OL = 7, Feature_localmachine_lockdown = 8, Feature_securityband = 9, feature_restrict_             Activexinstall = ten, Feature_validate_navigate_url = one, Feature_restrict_filedownload = 12, Feature_addon_management = Feature_protocol_lockdown = +, Feature_http_username_passwo rd_disable = Feature_safe_bindtoobject = +, Feature_unc_savedfilecheck = +, FEAT             ure_get_url_dom_filepath_unencoded = Feature_tabbed_browsing = 20, Feature_sslux = Feature_disable_navIgation_sounds = +, feature_disable_legacy_compression = Feature_force_addr_and_status = 23,             Feature_xmlhttp = Feature_disable_telnet_protocol = +, feature_feeds = 26, feature_block_input_prompts = Feature_entry_count = +, Private const int Set_featu         Re_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)] Staticextern int cointernetsetfeatureenabled (internetfeaturelist featureentry, [MarshalAs (Unmanagedty Pe.        U4)] int dwFlags, bool fenable);        [DllImport ("Winmm.dll")] public static extern int. int Waveoutgetvolume (INTPTR h, out uint dwvolume);        [DllImport ("Winmm.dll")] public static extern int Waveoutsetvolume (IntPtr h, uint dwvolume); private void Form1_Load (object sender, EventArgs e) {try {//Waveoutsetvolume (0, 0xFFFF); Suppresses the current process from making sound cointernetsetfeatureenabled (internetfeaturelist.                Feature_disable_navigation_sounds, set_feature_on_process, true);                UINT _savedvolume;                Waveoutgetvolume (IntPtr.Zero, out _savedvolume); This. FormClosing + = delegate {//restore the volume upon exit Waveoutsetv                Olume (IntPtr.Zero, _savedvolume);                };             Mute   Waveoutsetvolume (IntPtr.Zero, 0); } catch (Exception ex) {Console.WriteLine (ex.            Message); }}}

WebBrowser Mute (Refresh, click on the sound of the webpage) (including Flash mute)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.