Solved

Registry Information

Posted on 1998-03-17
4
142 Views
Last Modified: 2010-04-06
If I know the Value of a Key, how do i get the Key itself?  If I have a PCMCIA modem, and I eject it and reinsert it, the Key changes.  I need to get the value of this Key.  
0
Comment
Question by:jeffspence
4 Comments
 
LVL 2

Accepted Solution

by:
rene100 earned 200 total points
ID: 1360535
hi jeffspence, what's about that

first, get all key names with tregistry.getkeynames(tstrings)
then, you go down this list in a loop and set every key as current key with tregistry.openkey(keyname,false) and try
tregistry.getvaluenames(tstrings) on it. When you know the name
of the value, this method should work
hope this help

rene100

0
 
LVL 1

Expert Comment

by:Edo082297
ID: 1360536
Just a guess, does the key change any time or only if the key is kept open by your app ? Always use the CloseKey method as soon as possible.
If not, try to open the key one hierarcy step above and take rene100's solution.

Slash/d003303

0
 
LVL 4

Expert Comment

by:d003303
ID: 1360537
Rene, after submitting that question, we came up with the same solution!  we were hoping someone might have a better way, but I can't argue with someone that comes up with the exact same solution!! Thanks.
0
 

Author Comment

by:jeffspence
ID: 1360538
Why search through the entire registry? Is the value being stored to a different root? At least, set the RootKey. That way you aren't navigating through (potentially) megabytes of irrelevent key data.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

746 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

18 Experts available now in Live!

Get 1:1 Help Now