registry

Discussion in 'C Programming' started by news.ticino.com, Jul 11, 2003.

  1. Hi all,
    I would like my program to enumerate all the subkeys of HKEY_LOCAL_MACHINE.

    source:

    char buffer[255]="";
    int retval=22;
    FILETIME ftLastWriteTime;
    DWORD max = 255;
    int i;

    retval=RegOpenKeyEx(HKEY_LOCAL_MACHINE,NULL,0,KEY_READ,&rtch);

    for (i=0,retval=ERROR_SUCCESS;retval == ERROR_SUCCESS || retval
    ==ERROR_MORE_DATA;i++) {

    retval=RegEnumKeyEx(rtch,i,buffer,(LPDWORD)&max,NULL,NULL,NULL,&ftLastWriteT
    ime);
    printf("%s\n",buffer);
    }


    the program only enumerates the first 2 subkeys of HKEY_LOCAL_MACHINE but
    there are 5 subkeys.
    there must be a bug somewhere, unfortunately I can't find it.

    Can anyone help me?

    any help is appreciated.




    -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
    http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
    -----== Over 80,000 Newsgroups - 16 Different Servers! =-----
     
    news.ticino.com, Jul 11, 2003
    #1
    1. Advertising

  2. "news.ticino.com" <> wrote in
    news::

    > Hi all,
    > I would like my program to enumerate all the subkeys of
    > HKEY_LOCAL_MACHINE.


    You are using a platform specific API. You would have better luck in one of
    the comp.os.ms-windows.programmer.* groups.

    Sinan.

    --
    A. Sinan Unur

    Remove dashes for address
    Spam bait: mailto:
     
    A. Sinan Unur, Jul 11, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    1,173
  2. HK
    Replies:
    1
    Views:
    3,651
    Cowboy \(Gregory A. Beamer\)
    Apr 1, 2004
  3. Replies:
    0
    Views:
    757
  4. Leny
    Replies:
    3
    Views:
    16,935
    Daniel
    Feb 1, 2005
  5. Collin Miller
    Replies:
    10
    Views:
    609
    Roger Pack
    Jul 9, 2010
Loading...

Share This Page