Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Value Changed event for the Registry?

Posted on 2008-10-26
4
Medium Priority
?
553 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 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

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

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

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

722 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