Solved

RegEnumKeyEx example

Posted on 1997-10-26
1
3,024 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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

This article surveys and compares options for encoding and decoding base64 data.  It includes source code in C++ as well as examples of how to use standard Windows API functions for these tasks. We'll look at the algorithms — how encoding and decodi…
With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
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…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

778 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