Solved

Value Changed event for the Registry?

Posted on 2008-10-26
4
545 Views
Last Modified: 2012-08-13
Is there a Value Changed event for monitoring Windows XP registry using VB.Net?

There a program outside of my control that is incrementing a counter whose value is stored in the registry. What I'd like to do is know when that value has been changed so I can reset it if it's above a certain value. (kinda like what the FileSystemWatcher class does)

Does anyone know the best way to do this? The counter can get incremented frequently (depending on how often a user clicks or scrolls through a selection of names), so I want to do this as efficiently as possible.

A little example would be great.

Thanks, Jeff
0
Comment
Question by:JEFFCECCHINI
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 13

Accepted Solution

by:
TechTiger007 earned 500 total points
ID: 22810565
I think you should be using "RegNotifyChangeKeyValue" API from advapi.dll
Here is a wrapper around this API in C# you can convert it into vb.net

http://netcode.ru/dotnet/?lang=&katID=30&skatID=277&artID=7638
0
 
LVL 48

Expert Comment

by:jpaulino
ID: 22810785
Maybe a timer can do the job for you.
It's not a heavy task and you can do that very easily without slowing down the performance.
0
 

Author Closing Comment

by:JEFFCECCHINI
ID: 31510204
TechTiger007,
I checked it out quickly and that looks what I need to do. Hopefully when I get into it, it'll work for me.

Thanks  jeff
0
 

Author Comment

by:JEFFCECCHINI
ID: 22815738
Hi jpaulino,

I could take that approach but that really isn't inherintly linked to registry value being changed.

Consequently, the value could get reached before the pre-determined timer fires the check or on the other hand, the timer value could be too short causing a lot of unnessary calls to check the registry value when nothing has changed, that's why responding to an event is best for me.

Thanks though for your idea, as it was valuable. Hopefully TechTiger007's solution will work for me,

Jeff
0

Featured Post

Major Incident Management Communications

Major incidents and IT service outages cost companies millions. Often the solution to minimizing damage is automated communication. Find out more in our Major Incident Management Communications infographic.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question