473,770 Members | 1,994 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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_MACH INE\SOFTWARE\Mi crosoft\Windows NT\CurrentVersi on
\Prefetcher
The value of LastDiskLayoutT ime 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 '07 #1
4 3636

<Rh****@gmail.c omwrote in message
news:11******** **************@ n33g2000cwc.goo glegroups.com.. .
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_MACH INE\SOFTWARE\Mi crosoft\Windows NT\CurrentVersi on
\Prefetcher
The value of LastDiskLayoutT ime 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.programm er or
microsoft.publi c.vc.language or comp.os.ms-windows.program mer.win32 or
related.
Mar 6 '07 #2
On 6 Mar, 20:16, "Jim Langston" <tazmas...@rock etmail.comwrote :
<Rha...@gmail.c omwrote in message

news:11******** **************@ n33g2000cwc.goo glegroups.com.. .
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_MACH INE\SOFTWARE\Mi crosoft\Windows NT\CurrentVersi on
\Prefetcher
The value of LastDiskLayoutT ime 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.programm er or
microsoft.publi c.vc.language or comp.os.ms-windows.program mer.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 '07 #3
<Rh****@gmail.c omwrote in message
news:11******** **************@ 64g2000cwx.goog legroups.com...
On 6 Mar, 20:16, "Jim Langston" <tazmas...@rock etmail.comwrote :
><Rha...@gmail. comwrote in message

news:11******* *************** @n33g2000cwc.go oglegroups.com. ..
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_MACH INE\SOFTWARE\Mi crosoft\Windows NT\CurrentVersi on
\Prefetcher
The value of LastDiskLayoutT ime 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.programm er or
microsoft.publ ic.vc.language or comp.os.ms-windows.program mer.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.
Mar 6 '07 #4
On 6 Mar, 20:30, "Jim Langston" <tazmas...@rock etmail.comwrote :
<Rha...@gmail.c omwrote in message

news:11******** **************@ 64g2000cwx.goog legroups.com...
On 6 Mar, 20:16, "Jim Langston" <tazmas...@rock etmail.comwrote :
<Rha...@gmail.c omwrote in message
>news:11******* *************** @n33g2000cwc.go oglegroups.com. ..
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_MACH INE\SOFTWARE\Mi crosoft\Windows NT\CurrentVersi on
\Prefetcher
The value of LastDiskLayoutT ime 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.programm er or
microsoft.publi c.vc.language or comp.os.ms-windows.program mer.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 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1980
by: Pat Blair | last post by:
Sorry to anyone who read this post, but in case it's useful to anyone: Further experiments reveal that while a tuple comes back if you read a multi-line string, you set the value using a list (not a tuple). That's sensible and I don't know why this didn't occur to me before I posted. Thanks -----Original Message----- From: Pat Blair
4
3838
by: Lee | last post by:
I have created a custom log for my apps to write to. Writing to the log seems to be no problem, it's when I go to read it I get unexpected results. I have an application that reads the log and displays it's contents in a grid, and it also receives event notification from the log when it's updated. When the event fires I get exactly the text that was logged in exactly the way I logged, but when I read the entries from the log, or view them...
5
12950
by: Dhilip Kumar | last post by:
Hi All, I'm writing a Windows Service app using C#. I need to read some configuration settings before the service starts up. These settings will be used by the service in its operation. Question is, which is the best way to store & retrieve the settings? I'm thinking of storing it in the registry in HKLM\Software\ServiceName and access it using the Registry class in the "public ServiceName()" method. I'm instructing the service...
6
17837
by: Bry | last post by:
I'm having problems writing (and reading) boolean data to the registry. // Write a boolean value to the registry // I've not included the obvious bits of code in these samples bool myBool = true; myRegistryKey.SetValue("SomeValue", myBool); This gives me a registry value with string data containing "True" // Read my boolean data back from the registry
1
1671
by: Peter John | last post by:
I am using the following code to read from and write to the registry. The writing works fine but reading always fails. Can anyone suggest what is going wrong? Imports Microsoft.Win32 Public Class clsRegistry Private Const conRegKey As String = "Software\MyCompany\MyApplication"
5
5087
by: UJ | last post by:
I have a system that has five programs that all communicate with each other via Message Queues. Works well. One program is a watchdog that will make sure the others are up and going. Currently I have it store info it gets from when the programs check in into a DataSet (XML file). Problem is, that file now has to be used by other programs to find out version information (the file is ALWAYS less that 1K.) The record itself is only five fields...
0
4005
by: tmsprowl | last post by:
Greetings! I was wondering if someone could help me with a problem I'm having. My department is just one of many within my organization. My organization has control over the network domain, but my department has a couple of web servers of our own that are part of my organization's domain. I am trying to read LDAP information on my organization's domain controller from a web application on one of my department's servers. I have been...
2
2821
by: terryastone | last post by:
I have an application that reads some registry values stored in the Local Machine\Software\... key. In XP, I can see these values using RegEdit. In my application I can read the values at startup, and change the values during the application. In Vista, I CANNOT see the values using RegEdit but I can read the values using the application. I created some values using RegEdit in the place where my values would be. Now I can see them...
29
17618
by: Guillaume Dargaud | last post by:
Hello all, anybody knows if there's some ANSI-C conformant code around that can read Windows-style .ini files ? I don't care about writing to it but I need to be able to read it from various OSs, so there shouldn't be any Windows includes. It doesn't look like it's too hard to do, but there are a few tricks (like multiple line strings), so I'd love to save some time (who doesn't). -- Guillaume Dargaud
0
9618
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10259
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10101
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9906
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6710
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2849
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.