Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Value Changed event for the Registry?

Posted on 2008-10-26
4
Medium Priority
?
555 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
  • 2
4 Comments
 
LVL 13

Accepted Solution

by:
TechTiger007 earned 2000 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

Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

Question has a verified solution.

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

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…

916 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