🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #7784

Re: Listing Keys under a registry HIVE

#7784
From: Remy Lebeau (TeamB)
Date: Sat, 18 Dec 2004 22:50
31 lines
1999 bytes
"Maurice Anderson" <mauriceanderson@hotmail.com> wrote in message
news:41c48e73$1@newsgroups.borland.com...

> For example if I wanted to open HKEY_LOCAL_MACHINE\Software
> I would have to use both HKEY_LOCAL_MACHINE and Software as:
>
>     RegOpenKeyEx(HKEY_LOCAL_MACHINE, Software ...
>
> Then from there I could even enumerate the subkeys under Software.
>
> But my question is, how do I open HKEY_LOCAL_MACHINE so I
> could enumerate the keys under it?

Specify an empty key so you are opening the root hive itself:

    RegOpenKeyEx(HKEY_LOCAL_MACHINE, "", ...)

Or

    RegOpenKeyEx(HKEY_LOCAL_MACHINE, NULL, ...)

The documentation for RegOpenKeyEx() says the following:

    lpSubKey
    Points to a null-terminated string containing the name of the subkey to
open. If this parameter is NULL or a pointer to an empty string, the
function will open a new handle of the key identified by the hKey parameter.


Gambit
Technical Details
Message-ID: <41c4b40b@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!feeder.enertel.nl!nntpfeed-01.ops.asmr-01.energis-idc.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <41c48e73$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,15e78cde96ad308d
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <41c48e73$1@newsgroups.borland.com>
Subject: Re: Listing Keys under a registry HIVE
Date: Sat, 18 Dec 2004 14:50:32 -0800
Lines: 33
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 68.69.17.41
Message-ID: <41c4b40b@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1103410187 68.69.17.41 (18 Dec 2004 14:49:47 -0800)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!feeder.enertel.nl!nntpfeed-01.ops.asmr-01.energis-idc.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail