HKEY rkl = NULL;
RegCreateKeyEx(HKEY_CURRENT_USER, key_name, 0, NULL, 0, KEY_READ | KEY_ENUMERATE_SUB_KEYS | KEY_SET_VALUE , NULL, &rkl, NULL);
if (rkl == NULL)
return FALSE;
RegSetValueEx(rkl, "somestring", 0, REG_SZ, (unsigned char*)stringbuf, strlen(stringbuf)+1);
RegCloseKey(rkl);