|
-
Jul 10th, 2003, 01:53 AM
#1
Thread Starter
Member
Windows Registry Reading
Hello friends,
I want to read all subkeys under a particular key.
I got the function and tried. The codes are : -
// for enumerating the subkeys
int i = 0;
char subKeyName[SIZE] ;
memset(subKeyName, 0, SIZE);
DWORD Buffsize = SIZE;
PFILETIME time = NULL;
cout<<subKeyName;
do
{
if(RegEnumKeyEx(HKEY_CURRENT_USER, i, subKeyName, &Buffsize, 0, NULL, NULL, time) != ERROR_NO_MORE_ITEMS)
{
cout<<subKeyName<<"\n";
i++;
}
else
break;
}while(1);
The thing is it shows all subkey names but after showing first 3 - 4 names corectly the subsequent names are shown of having only 4-5 characters . e.g If subkey is Console then it is shown as Conso.
Any help ?
-
Jul 10th, 2003, 08:46 AM
#2
Reset Buffsize to SIZE on each iteration.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jul 11th, 2003, 12:10 AM
#3
Thread Starter
Member
Thanks Corned Bee. I did that and it worked perfectly.
See you again for next query. Till then bye.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|