const int FEATURE_DISABLE_NAVIGATION_SOUNDS = 21;  
    const int SET_FEATURE_ON_PROCESS = 0x00000002;  
      
    [DllImport("urlmon.dll")]  
    [PreserveSig]  
    [return: MarshalAs(UnmanagedType.Error)]  
    static extern int CoInternetSetFeatureEnabled(  
        int FeatureEntry,  
        [MarshalAs(UnmanagedType.U4)] int dwFlags,  
        bool fEnable);  
      
    static void DisableClickSounds()  
    {  
        CoInternetSetFeatureEnabled(  
            FEATURE_DISABLE_NAVIGATION_SOUNDS,  
            SET_FEATURE_ON_PROCESS,  
            true);  
    }  
默认情况下,IE内核的网页浏览框(WebBrowser、CHtmlView、CHtmlDialog等控件)在跳转网页、点击按钮时会发出声音,用CoInternetSetFeatureEnabled这个API可以禁止掉。

 

相关文章:

  • 2021-07-22
  • 2022-12-23
  • 2021-12-10
  • 2022-01-15
  • 2022-01-14
  • 2021-08-09
  • 2022-12-23
猜你喜欢
  • 2021-12-29
  • 2021-11-12
  • 2022-12-23
  • 2022-12-23
  • 2021-08-12
  • 2022-12-23
  • 2021-08-13
相关资源
相似解决方案