1

I have a webbrowser control on my form that runs in the background. The page is constantly refreshing. So I hear the refresh click everytime. Is there a way to mute it?

Thanks,

McGarnagle
  • 101,349
  • 31
  • 229
  • 260
user541597
  • 4,247
  • 11
  • 59
  • 87
  • possible duplicate of [HowTo Disable WebBrowser 'Click Sound' in your app only](http://stackoverflow.com/questions/10456/howto-disable-webbrowser-click-sound-in-your-app-only) – brendan May 17 '12 at 03:39
  • are sounds setting on your machine set to `no sound`? – TheVillageIdiot May 17 '12 at 03:40

1 Answers1

3

You can use following code snippet to solve this problem. It makes use of url monitor dll.

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);
}
doneyjm
  • 145
  • 6