How to Read values of Registry!

I wanna have my program read values of registry. I have some Defined keys and values stored inside it.
I wanna read 2 key and their values..How can I accomplish that!!
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You can use the RegQueryValue() or RegQueryValueEx() functions.

Let me know if you have any questions.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
veselAuthor Commented:
Thx for the reply. As a matter of fact I digged inside it and found how to use it! BTW I was looking for CODE....
I can provide code, but you given any details of what you want.  What is the key?  what type of data is stored with it?
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

Do the values that you want to read belong to your application or some other application?

If it belongs to your app, you should use:
GetProfileString(...)  to read.
WriteProfileString(...) to write to registry.

If it belongs to another app you should use the code found in:
Those functions are provided for compatibility only.  Use of those functions is discouraged.
The following is the code to read a value from the registry key
HKEY_LOCAL_MACHINE/SOFTWARE/Key1.  It reads the value of "Data1" and stores in pszValue which you can pass to the function.

HKEY hRoot,hLev1,hLev2,hLev3;
DWORD iType;
DWORD Value = iSize;
                              RegQueryValueEx(hLev3,"Data1",0,&iType,(unsigned char*)pszValue,(LPDWORD)&Value);      
While we're at it, what's up with this question.  Do you still want help?
veselAuthor Commented:
I got it!! working Thx for the concern
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.