By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,758 Members | 1,272 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,758 IT Pros & Developers. It's quick & easy.

Monitor or hook a call to the Registry, and swap the returned value

P: n/a
Hi,

Is there any way in which I can monitor / hook the Registry, and upon a
call to a specific key from a specific application - swap the returned
value?

I was thinking of using this method to overcome the "click" sound of
the WebBrowser, without having to affect the Registry permanently. This
way I could monitor the call for the sound file to be played (located
in
HKEY_CURRENT_USER\AppEvents\Schemes\Apps\Explorer\ Navigating\.Current)
and hope to return an empty or null string instead.

Any idea on how to do this?

Thanks.

Sep 25 '06 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Just a thought.....

Wouldn't it be easier to use System.Diagnostics.Process to watch for the
application to start - change the value in the registry to a non-clicking
sound - then, when the app closes, change it back?

You'd probably want this solution running as a service.

Even easier (and no service needed) would be to write a tiny app that
changes the registry key, launches the webbrowser and replaces the registry
key when the browser closes.

Just a thought.....


"ewolfman" <ew******@yahoo.comwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
Hi,

Is there any way in which I can monitor / hook the Registry, and upon a
call to a specific key from a specific application - swap the returned
value?

I was thinking of using this method to overcome the "click" sound of
the WebBrowser, without having to affect the Registry permanently. This
way I could monitor the call for the sound file to be played (located
in
HKEY_CURRENT_USER\AppEvents\Schemes\Apps\Explorer\ Navigating\.Current)
and hope to return an empty or null string instead.

Any idea on how to do this?

Thanks.

Sep 25 '06 #2

P: n/a
Yeah, but thats the easy solution. Although it has its downsides too,
because it affects all navigation till the app closes, plus you can
never know if the app will not crash before it resets the Registry back
to its original value.

That's why I was looking for a different solution.
smerf wrote:
Just a thought.....

Wouldn't it be easier to use System.Diagnostics.Process to watch for the
application to start - change the value in the registry to a non-clicking
sound - then, when the app closes, change it back?

You'd probably want this solution running as a service.

Even easier (and no service needed) would be to write a tiny app that
changes the registry key, launches the webbrowser and replaces the registry
key when the browser closes.

Just a thought.....


"ewolfman" <ew******@yahoo.comwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
Hi,

Is there any way in which I can monitor / hook the Registry, and upon a
call to a specific key from a specific application - swap the returned
value?

I was thinking of using this method to overcome the "click" sound of
the WebBrowser, without having to affect the Registry permanently. This
way I could monitor the call for the sound file to be played (located
in
HKEY_CURRENT_USER\AppEvents\Schemes\Apps\Explorer\ Navigating\.Current)
and hope to return an empty or null string instead.

Any idea on how to do this?

Thanks.
Sep 25 '06 #3

P: n/a
As you said, "you can never know if the app will not crash before it resets
the Registry back to its original value." This holds true for the easy
approach as well as hooking system events. In fact, it is even more of a
danger when hooking system events. If an app crashes while hooking system
events, this can cause the system to behave in unforeseen ways, even
crashing the system.

There are registry events that you can hook into using WMI or C++ at
http://windowssdk.msdn.microsoft.com.../ms747845.aspx but it does
not work for the HKEY_CURRENT_USER hive and only monitors changes - not
reads.

And, although I know you don't like doing things the easy way, you could
always simply open the Windows Control Panel, then open sound properties
dialog and either choose silent sound scheme or just set no sound for start
navigation event.

Is there a reason for not setting this property permanently via the sound
properties control panel applet? After all, that sound sure is annoying.

"ewolfman" <ew******@yahoo.comwrote in message
news:11*********************@h48g2000cwc.googlegro ups.com...
Yeah, but thats the easy solution. Although it has its downsides too,
because it affects all navigation till the app closes, plus you can
never know if the app will not crash before it resets the Registry back
to its original value.

That's why I was looking for a different solution.
smerf wrote:
>Just a thought.....

Wouldn't it be easier to use System.Diagnostics.Process to watch for the
application to start - change the value in the registry to a non-clicking
sound - then, when the app closes, change it back?

You'd probably want this solution running as a service.

Even easier (and no service needed) would be to write a tiny app that
changes the registry key, launches the webbrowser and replaces the
registry
key when the browser closes.

Just a thought.....


"ewolfman" <ew******@yahoo.comwrote in message
news:11**********************@h48g2000cwc.googleg roups.com...
Hi,

Is there any way in which I can monitor / hook the Registry, and upon a
call to a specific key from a specific application - swap the returned
value?

I was thinking of using this method to overcome the "click" sound of
the WebBrowser, without having to affect the Registry permanently. This
way I could monitor the call for the sound file to be played (located
in
HKEY_CURRENT_USER\AppEvents\Schemes\Apps\Explorer\ Navigating\.Current)
and hope to return an empty or null string instead.

Any idea on how to do this?

Thanks.

Sep 26 '06 #4

P: n/a
I'm aware of the WMI capabilities, and this is why I asked the question
in the first place.

Its not that I don't like the easy way - of course I'd like to find an
easy way. The thing is that I don't think that switching the navigation
sound off, globaly, for the purpose of a single client application
instance, is the correct choice (unless I don't have any other choice,
and in this case I will ask the user for permission to do so).

Sep 26 '06 #5

P: n/a
There is one other option for your user... You can use AutoIT (freeware) to
give your user a simple icon to double click to turn the sound on or off.
You can get it at http://www.autoitscript.com/autoit3/. You can even make
compiled executable scripts that can be run without having to install AutoIT
on the users system.

Sorry I couldn't be of more help. Good luck to you.
"ewolfman" <ew******@yahoo.comwrote in message
news:11*********************@e3g2000cwe.googlegrou ps.com...
I'm aware of the WMI capabilities, and this is why I asked the question
in the first place.

Its not that I don't like the easy way - of course I'd like to find an
easy way. The thing is that I don't think that switching the navigation
sound off, globaly, for the purpose of a single client application
instance, is the correct choice (unless I don't have any other choice,
and in this case I will ask the user for permission to do so).

Sep 26 '06 #6

P: n/a
Sorry I couldn't be of more help. Good luck to you.

Thanks for trying.

Sep 27 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.