Reading/Writing from/to windows registry using C++

Discussion in 'C++' started by RhavoX, Mar 6, 2007.

  1. RhavoX

    RhavoX Guest

    Hi. This may be a very stupid question but I'll leave you to judge
    it ;) I know there were lots of questions about this but none of the
    answers suits me.
    I'm wondering how to get the BINARY type data from the registry and
    how to display it as hex in a way I'm showing below.

    Let's say I use this key:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion
    \Prefetcher
    The value of LastDiskLayoutTime is: 6A C7 49 ED 50 5F C7 01
    Now i wonder how to receive this type of data and how to display it in
    this form... Same goes for writing it to the registry... I have no
    problems with using REG_SZ and DWORDS so even little help will be
    highly appreciated ;)

    Thx ;)
     
    RhavoX, Mar 6, 2007
    #1
    1. Advertisements

  2. RhavoX

    Jim Langston Guest

    OS specific, try mocrosft.public.win32.programmer or
    microsoft.public.vc.language or comp.os.ms-windows.programmer.win32 or
    related.
     
    Jim Langston, Mar 6, 2007
    #2
    1. Advertisements

  3. RhavoX

    RhavoX Guest

    Yeah that would solve the problem but I really prefer C++/WinApi and I
    would like to do it that way ;)
     
    RhavoX, Mar 6, 2007
    #3
  4. RhavoX

    Jim Langston Guest

    You will have to use a C++ WinAPI, but to find out which WinAPI to use
    you'll have to ask in a microsoft newsgroup.
     
    Jim Langston, Mar 6, 2007
    #4
  5. RhavoX

    RhavoX Guest

    Thx for help ;) I just tried to use standard libraries found in Dev C+
    + environment... They are ok and as I said they allow reading the
    registry dword and reg_sz values. I took a look into winreg.h and it
    has REG_BINARY included... But using that type doesn't do anything..
    Anyway thx again for pointing me the right direction ;). I'll try
    asking there.
     
    RhavoX, Mar 6, 2007
    #5
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.