Depending on the site which you are running this at, the HKEY_LOCAL_MACHINE
may be locked for Services and Adminstrator users only to access. When
using RegEdit on such a machine I believe it uses a Service to interact with
the Registry which is why it is not affected. Try saving/retrieving the
details from HKEY_CURRENT_USER as that is usually not locked off.
Otherwise possibly try accessing the Registry API directly yourself. If you
have trouble finding examples of the API calls send me a private email and I
can get some sample code for ya. (I have my own registry dll that I created
and use.)
Hope that helps
Syphtor