Below is the code to create a registry key in VC++. I used visual studio 2008 for this(VC9)
RegCreateKeyEx is the command to create the key. More documentation can be found online@ msdn.
#include “stdafx.h”
#include “Windows.h”
int _tmain(int argc, _TCHAR* argv[])
{
HKEY hOutKey;
RegCreateKeyEx(HKEY_LOCAL_MACHINE, L”SOFTWARE\ABC\Registration\addkey”,
0, 0, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hOutKey, NULL);
return 0;
}
Leave a Reply