| Author |
How to read registry
|
|
| Lars-Erik Østerud 2007-03-20, 4:25 am |
| I try to read the registry from Delphi Win32.
But the help is not that good, and I can't get anything.
I have tried this:
VAR reg:Tregistry;
BEGIN
reg:=TRegistry.Create;
string1:=Reg.CurrentPath;
string2:=Reg.CurrentKey;
But they all are empty strings...
Tried changing the "RootKey" as well, but it expects an number value
(even if the help says you could set it to a STRING), the SetRootKey
procedure is private so I can't use that either :-(
Tried using the "Reg.OpenKeyReadOnly" as well to set a path,
but all the values above still return a blank string...
What am I doing wrong...
Can someone post a short code for reading a STRING form a registry
key?
--
Lars-Erik - http://www.osterud.name - ICQ 7297605
| |
|
| Lars-Erik Østerud wrote:
> I try to read the registry from Delphi Win32.
>
> But the help is not that good, and I can't get anything.
>
> I have tried this:
>
> VAR reg:Tregistry;
>
> BEGIN
> reg:=TRegistry.Create;
> string1:=Reg.CurrentPath;
> string2:=Reg.CurrentKey;
>
> But they all are empty strings...
>
> Tried changing the "RootKey" as well, but it expects an number value
> (even if the help says you could set it to a STRING), the SetRootKey
> procedure is private so I can't use that either :-(
>
>
> Tried using the "Reg.OpenKeyReadOnly" as well to set a path,
> but all the values above still return a blank string...
>
> What am I doing wrong...
>
> Can someone post a short code for reading a STRING form a registry
> key?
you have to open the key first..
if it fails, this means it's a security problem, or some one else
has it already opened.
--
"I'm never wrong, once i thought i was, but was mistaken"
Real Programmers Do things like this.
http://webpages.charter.net/jamie_5
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|