Oh, Neat: A Hack To Fix The IE Click Problem

6:08 pm C/C++, Internet Explorer, Programming, Tutorials

I always wondered how applications suppressed that god-awful clicking sound in embedded IE. Usually you catch them screwing with user preferences, but there’s a utility I have which never showed any apparent method of getting rid of the goddamned noise. I always assumed they just styled text to look like a link.

Well, I still don’t know what he does, but I found a way.

Back in post #141, More IE Woes, I documented several problems. One was that MSDN claims this noise cannot be suppressed. Indeed, by design, IE6 refuses to allow you to suppress that sound (god knows why.) That MSDN article goes as far as to tell you to override the user’s sound preferences to turn the noise off. How badbear is that? Anyway, IE7 finally has an interface to turn that off, called FEATURE_DISABLE_NAVIGATION_SOUNDS. However, people like me who are reluctant to make their applications non-functional without IE7 will not like that answer.

It turns out there’s a better way.

There’s a moderately obscure interface from IE5 for IDocHostUIHandler called GetOptionKeyPath. The superficial purpose of this is to allow the IE embedder to create a fake user, so that they can set defaults for IE like the basic font size, background color and so on. This is generally completely ignored in favor of some CSS, but it turns out that this thing actually covers the sound effect scheme too.

All you need to do is use GetOptionKeyPath, create a fake user, override the OnNavigate sound (and maybe some others) to nothing, and let the rest alone, to default to the user’s preferences.

Bang: no more clicky noise, and no overriding preferences, breaking other applications and risking corrupting preferences on crash.

Very clean. :)

4 Responses

  1. FatBlog » Checklist for Embedded IE Says:

    [...] Get rid of the OnNavigate noise (the clicking sound when you hit a link.)  This is harder than it should be. [...]

  2. Steve Johnson Says:

    stonecypher -

    Could ya give us a little more information? It appears the sound setting is rooted in:

    HKCU\AppEvents\Schemes\Apps\Explorer

    and the rest of the IE settings are rooted in:

    HKCU\Software\Microsoft\Internet Explorer.

    I am using CHtmlView::OnGetOptionKeyPath() – which path/value should I use?

  3. svenyonson Says:

    Could you specify the exact registry key to change to turn off the click sound?

    It appears that sound settings are stored in a different place than fonts, etc, and so I am not sure of the relative keyname and the value name to change, relative to the string returned in GetOptionKeyPath.

    Thanks.

  4. Martin Saunders Says:

    Hi,

    This is exacly what I am trying to achieve. I think you are about a lightyear ahead of me in scripting though.

    Would it be possible to see the full script used to turn the click off?

    Thanks,

    Martin Saunders

Leave a Comment

Your comment

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.