Registry Access

Hello,
I'm having problems with the registry.. and the Win32 API Reference isn't exactly clear.
Say I wanted to greet the user by the name stored in the registry, located at:

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Curr entVersion

The data value that I want to read is "RegisteredOwner" - after this I would simply display a message box.

Also, how can I set a value in the registry? I can use RegSetValue but that only stores data in the registry as the "default" data value - perhaps I want to store a value in the registry under a certain key with the string value name of "User".. To put this in more simple terms, I wish to achieve the same effect as the following ".key" file:
REGEDIT4

I think you could probably do something similar to write to data to a key using RegSetValueEx(). However you'll need to adjust the access when opening the key, and ensure the person using your program has admin rights on NT based Windows.

Assuming you'd already opened the HKEY_LOCAL_MACHINE\Software\MySoftware with the required access using RegOpenKeyEx(). This is untested so you may have to changed it around to get the required result.