Solved

Value Changed event for the Registry?

Posted on 2008-10-26
4
542 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 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

863 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now