Solved

RegEnumKeyEx example

Posted on 1997-10-26
1
3,013 Views
Last Modified: 2013-12-03
Hi,
I Need an example with RegEnumKeyEx.
Thanx
0
Comment
Question by:puce020497
1 Comment
 

Accepted Solution

by:
jasiek earned 50 total points
ID: 1407882
In this routine you query registry to combobox:

HKEY reg_key;
char buff[0xffff]; // temp buffer
DWORD bufflen=sizeof(buff);
int index;
CComboBox m_KeyList; // return value object

CString YOUR_MASTER_KEY="Software\\your_app\\your_subkey\\";
CString REG_YOUR_ENTRY="Profile";
if(RegOpenKeyEx(HKEY_CURRENT_USER,
YOUR_MASTER_KEY+REG_YOUR_ENTRY,
0,
KEY_QUERY_VALUE | KEY_ENUMERATE_SUB_KEYS,
&reg_key)!=ERROR_SUCCESS)
{
// key not found
}

index=0;
bufflen=sizeof(buff);
      while(RegEnumKeyEx(reg_key,
index,
buff,
&bufflen,0,0,0,0)==ERROR_SUCCESS)
{
      if(buff[0]!=0)
      m_KeyList.AddString(buff);
      index++;
      bufflen=sizeof(buff);
}
RegCloseKey(reg_key);
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now