Re: Best Way to Implement Registry?
From: Rob Kennedy (me3_at_privacy.net)
Date: 05/30/04
- Previous message: Evil miniFAQ Boss: "FAQ: comp.lang.pascal.delphi.misc miniFAQ (short version)"
- In reply to: Winston Tuck: "Best Way to Implement Registry?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 30 May 2004 00:37:16 -0500
Winston Tuck wrote:
> What is the best way to use the registry so that the applicaiton will work
> on all version of Windows. I used the HKEY_LOCAL_MACHINE before but had
> problems with Server 2000. I then started using txt files instead but still
> prefer the registry and want to apply it again.
Put user-specific data in HKey_Current_User. Put computer-specific data
in HKey_Local_Machine. All 32-bit versions of Windows have both those keys.
When opening a registry key, ask for only the minimum permissions
required to perform your task. If all you need to do is read a setting,
then don't request write access or delete access. (See the help on the
TRegistry.Access property and OpenKeyReadOnly method.)
If you want to use files, then store user-specific data somewhere in the
user's profile directory (such as My Documents), and store
computer-specific data in the "all users" profile directory. Do not
count on being able to write to your program's installation directory.
Microsoft's logo-specification document (link below) outlines where you
should store different kinds of data and provides some examples (in C)
for how you can do that. The advice applies to all versions of Windows,
although the earliest versions of Windows 95 require you to include a
separate DLL with your program.
http://www.microsoft.com/winlogo/software/downloads.mspx
-- Rob
- Previous message: Evil miniFAQ Boss: "FAQ: comp.lang.pascal.delphi.misc miniFAQ (short version)"
- In reply to: Winston Tuck: "Best Way to Implement Registry?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|