Use the Win32 registry functions. Ugly, yes, but they work:// First create the key. HKEY hNewKey = NULL; DWORD disposition = 0; DWORD error = ::RegCreateKeyEx(HKEY_LOCAL_MACHINE, "Software\\Extensions\\Demo App", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hNewKey, &disposition); // Now create the value char myString[] = "Some Data"; error = ::RegSetValueEx(hNewKey, "Some Value", NULL, REG_SZ, myString, sizeof(myString));
See MSDN on RegCreateKeyEx and RegSetValueEx for more info. (The code I provided is just a rough example... should compile and work but I can't be sure!) Sometimes I feel like I'm a USB printer in a parallel universe.