472,776 Members | 2,527 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,776 software developers and data experts.

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

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
6 2439
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
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
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
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
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
Sorry I couldn't be of more help. Good luck to you.

Thanks for trying.

Sep 27 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: bughunter | last post by:
Hi, Consider this code: ---- Monitor.Pulse(oLock); Monitor.Exit(oLock); ---- If a thread was waiting on oLock then will the current thread
11
by: Michi Henning | last post by:
Hi, I'm calling Monitor.Wait() from a console event handler. It's not working -- the call to Wait() immediately causes the process to exit. Is it impossible for some reason to call Wait() from...
4
by: msnews.micorsoft.com | last post by:
i want to receive a message when a window was activated. I use the WH_CBT type hook to process,the code is following: LRESULT CALLBACK CBTProc(int nCode,WPARAM wParam, LPARAM lParam) { HWND hWnd;...
9
by: Jesse | last post by:
Hi All, I want to be able to make an engine in VB.Net which creates a bridge between applications and the system registry, so before it's processed by the O/S, I want to be able to have the...
11
by: Yelena Varshal via AccessMonster.com | last post by:
Hello, I have a problem with one of msaccess.exe API calls that work on my desctop but does not work on the laptop from within MS ACCESS. There is a lot of differences between 2 computers...
12
by: Perecli Manole | last post by:
I am having some strange thread synchronization problems that require me to better understand the intricacies of Monitor.Wait/Pulse. I have 3 threads. Thread 1 does a Monitor.Wait in a SyncLock...
10
by: RobinS | last post by:
Hello to all, and happy new year! I have this application that someone wrote that I'm sort of checking out. The forms look fine in design mode, but when I run the application, it crops off the...
2
by: TwistedPair | last post by:
All, This is sort of a continuation of a previous post of mine. The code below basically reads a registry key to get a path to a folder and it watches for files created in that folder (only...
0
by: TwistedPair | last post by:
All, I had some great advice about this a bit ago, but I'm just not good enough with this code to put together all the pieces. The way the code below works is as a service. When it is started,...
0
by: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.