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

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

  1. 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 ;)
    , Mar 6, 2007
    #1
    1. Advertising

  2. Jim Langston Guest

    <> wrote in message
    news:...
    > 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 ;)


    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. Advertising

  3. Guest

    On 6 Mar, 20:16, "Jim Langston" <> wrote:
    > <> wrote in message
    >
    > news:...
    >
    >
    >
    > > 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 ;)

    >
    > OS specific, try mocrosft.public.win32.programmer or
    > microsoft.public.vc.language or comp.os.ms-windows.programmer.win32 or
    > related.


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

    <> wrote in message
    news:...
    > On 6 Mar, 20:16, "Jim Langston" <> wrote:
    >> <> wrote in message
    >>
    >> news:...
    >>
    >>
    >>
    >> > 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 ;)

    >>
    >> OS specific, try mocrosft.public.win32.programmer or
    >> microsoft.public.vc.language or comp.os.ms-windows.programmer.win32 or
    >> related.

    >
    > Yeah that would solve the problem but I really prefer C++/WinApi and I
    > would like to do it that way ;)


    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. Guest

    On 6 Mar, 20:30, "Jim Langston" <> wrote:
    > <> wrote in message
    >
    > news:...
    >
    >
    >
    > > On 6 Mar, 20:16, "Jim Langston" <> wrote:
    > >> <> wrote in message

    >
    > >>news:...

    >
    > >> > 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 ;)

    >
    > >> OS specific, try mocrosft.public.win32.programmer or
    > >> microsoft.public.vc.language or comp.os.ms-windows.programmer.win32 or
    > >> related.

    >
    > > Yeah that would solve the problem but I really prefer C++/WinApi and I
    > > would like to do it that way ;)

    >
    > 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.


    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.
    , Mar 6, 2007
    #5
    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. HK
    Replies:
    1
    Views:
    3,595
    Cowboy \(Gregory A. Beamer\)
    Apr 1, 2004
  2. Replies:
    0
    Views:
    725
  3. Leny
    Replies:
    3
    Views:
    16,895
    Daniel
    Feb 1, 2005
  4. Pat Blair
    Replies:
    1
    Views:
    722
    Mark Hammond
    Feb 6, 2004
  5. Collin Miller
    Replies:
    10
    Views:
    566
    Roger Pack
    Jul 9, 2010
Loading...

Share This Page