?
Solved

How can I get all data names and values in a subkey in the registry?

Posted on 2002-03-08
1
Medium Priority
?
258 Views
Last Modified: 2010-04-01
How can I get all data names and values in a subkey in the registry? If a key have many Data names and value what is the way to get all data name and its values?
support with code Please .
0
Comment
Question by:AHD
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 86

Accepted Solution

by:
jkr earned 520 total points
ID: 6850314
Use 'RegEnumValue()' - a sample can be found at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/regapi_0tq1.asp ("Using the Registry"):

    if (cValues)
    {
        for (j = 0, retValue = ERROR_SUCCESS;
                j < cValues; j++)
        {
            cchValue = MAX_VALUE_NAME;
            achValue[0] = '\0';
            retValue = RegEnumValue(hKey, j, achValue,
                &cchValue,
                NULL,
                NULL,    // &dwType,
                NULL,    // &bData,
                NULL);   // &bcData
 
            if (retValue != (DWORD) ERROR_SUCCESS && 
                    retValue != ERROR_INSUFFICIENT_BUFFER)
            {
                wsprintf (achBuff,
                    "Line:%d 0 based index = %d, retValue = %d, " 
                     "ValueLen = %d",
                     __LINE__, j, retValue, cchValue);
                MessageBox (hDlg, achBuff, "Debug", MB_OK);
            }
 
            achBuff[0] = '\0';
 
            // Add each value to a list box.
            if (!lstrlen(achValue))
                lstrcpy(achValue, "<NO NAME>");
            wsprintf(achBuff, "%d) %s ", j, achValue);
            SendMessage(GetDlgItem(hDlg,IDL_LISTBOX2),
                LB_ADDSTRING, 0, (LONG) achBuff);
        }
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
Suggested Courses

764 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