Solved

RegEnumKeyEx example

Posted on 1997-10-26
1
2,992 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

746 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

12 Experts available now in Live!

Get 1:1 Help Now