HKEY pkey=NULL;
DWORD d_size, CreateMode;
DWORD dwData;
char s_data[300];
strcpy(s_data, "This is the test registry key")
if(RegCreateKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\YourRegKeys\\YourFirsRegKey", 0, NULL, REG_OPTION_NON_VOLATILE,
KEY_ALL_ACCESS, NULL, &pkey, &CreateMode)==ERROR_SUCCESS)
{
d_size=strlen(s_data);
RegSetValueEx(pkey, "Excel Source", NULL, REG_EXPAND_SZ, (LPBYTE) s_data, d_size);
RegCloseKey(pkey);
}