Here you go... http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx

Unless you have an aversion to using classes, I suggest you use the ATL CRegKey class (all you need to do to use it is include <atlbase.h>).