Question:
how is the windows registry programmed?
charchar88
2010-08-21 07:28:01 UTC
I understand it's a database that holds on system/application configurations in windows but how does this all work from a programming/code level? I'm learning C and Java programming languages (2nd year) and we usually call what we need from other files. I read that the registry replaces .INI files but how are settings from the registry called by other programs? Was the registry written in C or some other Win API?
Five answers:
peteams
2010-08-21 07:56:53 UTC
The registry is viewed as a hierarchy of named values. The names are strings, the values can be of various types.



Raw access to the registry is through the Win32 API, RegOpenKey is probably the function you need to look out first (it's like the file open for the registry). RegOpenKey is part of a family that provide all the registry operations.



The registry is available from most languages that permit privileged operations. The registry itself is written in C++ code, as is most of the core of Windows.
Base
2010-08-21 14:59:13 UTC
http://msdn.microsoft.com/en-us/library/ms724871(v=VS.85).aspx

From MSDN: The registry is a system-defined database in which applications and system components store and retrieve configuration data. The data stored in the registry varies according to the version of Microsoft Windows. Applications use the registry API to retrieve, modify, or delete registry data.

You should not edit registry data that does not belong to your application unless it is absolutely necessary.







Here are a few examples of how settings are called or written to the registry through C.



Registry Examples in C:

http://www.tenouk.com/ModuleP1.html



Look up these in MSDN:

RegOpenKeyEx()

RegQueryValueEx()

RegEnumKeyEx()

RegEnumValue()
hemppy
2010-08-21 14:51:30 UTC
hi charchar..., ya know you are displaying that same thing i did a little while back learning soo much that i started forgetting the easy things that can happen when you are learning. so i highly recommend that you study a quick review and while you do it breath deep. the instructor wants your mind open and rested and sharp this question was so easy even a person in their first year would have known the answer. i lnow what you are learning is not so hard but it is mind bugling all of the knew languages that you must be learning so trust me i am not poking fun i just recognize the what is happening to you. always the system is on C:\ driver and that is included in registry bios or your system itself so by all means please review what you have already studied and allow me to pat you on your back for the good work you are doing. i am self taught so i bought at hastings some old tech books and started studying the same thing only not quite advanced and trust me after three weeks of study every day including weekends i had to review. so take it easy and hope i helped you good luck.
Ehsan T
2010-08-21 14:33:54 UTC
Windows registry is not a compiled application and it stores data in it's own data structure.

you can access the data in windows registry for read/write by any programing language like accessing data stored in a text file or in an Oracle database.
The J-man
2010-08-21 14:32:58 UTC
Last I checked the registry was programmed in C I think, which is why it uses all the byte values and DWORDs etc. Don't quote me on this though ;D.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...