DELPHI和注册表

2016-01-29 14:01 13 1 收藏

DELPHI和注册表,DELPHI和注册表

【 tulaoshi.com - Delphi 】

 

0. DISCLAIMER:
1. What is the registry?
2. What does the registry look like?
3. How to read and write data to the registry
    3.1 RegCreateKey()
    3.2 RegOpenKey()
    3.3 RegSetValue()
    3.4 RegQueryValue()
    3.5 RegDeleteKey()
    3.6 RegEnumKey()
4. An Example
5. Win95 features
6. REGDLL.DLL

(本文来源于图老师网站,更多请访问http://www.tulaoshi.com/delphi/)

The source code corresponding to this article is available for download as
registry.zip.
 
 

0. DISCLAIMER:

This article reflects my personal experiences with the registry and Delphi.
I had no 'real' documentation on this, except what shipped with Delphi. I
will not take any responsibility that occurs from the usage of the
procedures described in this article. The same applies to the usage of the
accompanying REGDLL.DLL and its interface. USE AT YOUR OWN RISK.

Suggestions and Comments are welcome. Please send them to:
Christian.Feichtner@jk.uni-linz.ac.at.

This article describes how to use the registry-database as an 'INI file'.
Especially with the advent of Windows 95 every 'good' windows application
should use the registry database to store its information.

Note that the described API routines are from the 16bit API. They work well
with the registry of Windows 95, but are not capable of using the special
new features of Windows 95.
 
 

1. What is the registry?

(本文来源于图老师网站,更多请访问http://www.tulaoshi.com/delphi/)

The registry is a heirarchical database, which is used to store information
for the whole system. OLE-apps made frequent use of the registry in Win31.
In Windows 95 the registry has grown to more than that. It not only stores
system information but has become a total replacement for the old-style INI
files. The INI files are only supported to maintain compatibility for 'old'
16bit Apps.
 
 

2. What does the registry look like?

As mentioned above, the registry is a heirarchical database. It is
organized as a tree. The most interesting key (and the only one accessable
from Delphi with the 16bit version) is the HKEY_CLASSES_ROOT.

This key can be used to store application settings. (Thus, I think there is
another key for Windows 95 apps. Since Delphi can only access this key, you
can use it until Delphi-32 becomes avaliable).

Example:

 + HKEY_CLASSES_ROOT      This is what a key could look like. Assume an
 |                        application named Information Manager (which I'm
 +--+-.IFM                currently developing) which saves its files with the
    |  

来源:http://www.tulaoshi.com/n/20160129/1492309.html

延伸阅读
标签: 电脑入门
XP中手动备份注册表的步骤 单击开始,单击运行,键入 %SystemRoot%system32restorerstrui.exe,然后单击确定。 在欢迎使用系统还原页面上,单击创建一个还原点,然后单击下一步。 在创建一个还原点页面上,键入该还原点名称,然后单击创建 还原点创建后,单击关闭。 注意 如果已关闭系统还原,将收到一条消息,询问现在是否要打开系统还...
应用程序在启动和运行时需要将一些重要的信息保存起来,以便在下次启动和运行时使用。在Windows16位操作系统中,使用系统初始化文件(INI)来存取重要参数。在微软WIN95及最新的WIN98系统中,却是采用注册表来存放应用程序的启动及运行所需的重要参数。 注册表的存取方法一般有以下两种: 一、使用WIN95提供的注册表编辑器。使用方法为:点“开始...
标签: Web开发
$shell = new COM("WScript.Shell") or die("This thing requires Windows Scripting Host"); $registry_proxystring = $shell-RegRead ("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\ProxyServer"); 同样可以用RegWrite方法写入 如果有问题,请参考相关资源:[url]http://support.microsoft.co...
标签: ASP
       一个例子:   <%Dim ReadComputerName   Set ReadComputerName=CreateObject("WScript.Shell")   Dim ComputerName,RegPath   RegPath="HKLM\System\CurrentControlSet\Control\ComputerName\ComputerName\ComputerName"   ComputerName=...
标签: 电脑入门
由于驱动或网卡的关系,有的机器中没有 Network Address 项,那我们只有通过修改注册表来进行修改了。 1 、在 HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlClass{4D36E972- E325-11CE-BFC1-08002BE10318}