The registry is not as easy to use as it was in the early days - because a lot of apps stored way too much in it, it became bloated, and that slowed down the whole OS.
So now, much of the registry is access protected, and for the HKEY_CURRENTUSER values you need your app to be running under your user at the very least (and still may not be able to access parts of it in future) and it may require your app to be elevated.
Avoid using the registry at all: access can only get tighter so it's more likley you app will fail in future.
Have a look here: Where should I store my data?
] for some better ideas, or use a settings file instead.