registry

N

news.ticino.com

Hi all,
I would like my program to enumerate all the subkeys of HKEY_LOCAL_MACHINE.

source:

char buffer[255]="";
int retval=22;
FILETIME ftLastWriteTime;
DWORD max = 255;
int i;

retval=RegOpenKeyEx(HKEY_LOCAL_MACHINE,NULL,0,KEY_READ,&rtch);

for (i=0,retval=ERROR_SUCCESS;retval == ERROR_SUCCESS || retval
==ERROR_MORE_DATA;i++) {

retval=RegEnumKeyEx(rtch,i,buffer,(LPDWORD)&max,NULL,NULL,NULL,&ftLastWriteT
ime);
printf("%s\n",buffer);
}


the program only enumerates the first 2 subkeys of HKEY_LOCAL_MACHINE but
there are 5 subkeys.
there must be a bug somewhere, unfortunately I can't find it.

Can anyone help me?

any help is appreciated.
 
A

A. Sinan Unur

Hi all,
I would like my program to enumerate all the subkeys of
HKEY_LOCAL_MACHINE.

You are using a platform specific API. You would have better luck in one of
the comp.os.ms-windows.programmer.* groups.

Sinan.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top