Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

RegEnumKeyEx example

Posted on 1997-10-26
1
Medium Priority
?
3,172 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 200 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

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

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

If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
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…
Loops Section Overview

916 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