Here's a code I use (ignored error checking) to read two registry values, combine them and write them to a third one.
unsigned long type=REG_SZ, size=1024;
char iLike[1024]="";
char Apples[1024]="";
char iLikeApples[1024]="";
LONG rV;
HKEY hKey = NULL;
// reading the first value
rV = RegOpenKeyEx(HKEY_CURRENT_USER, "SOFTWARE\\FARM\\ValueName1", 0, KEY_ALL_ACCESS, hKey);
rV = RegQueryValueEx(hKey, "Value1", NULL, type, (LPBYTE)iLike, size);
RegCloseKey(hKey);
// reading the second value
rV = RegOpenKeyEx(HKEY_CURRENT_USER, "SOFTWARE\\FARM\\ValueName2", 0, KEY_ALL_ACCESS, hKey);
rV = RegQueryValueEx(hKey, "Value2", NULL, type, (LPBYTE)Apples, size);
RegCloseKey(hKey);
// combining values
[code?]
// writing the third value
rV = RegOpenKeyEx(HKEY_CURRENT_USER, "SOFTWARE\\FARM\\ValueName3", 0, KEY_ALL_ACCESS, hKey);
rV = RegSetValueEx(hKey, "Value3", 0, REG_SZ, [parameter1?], [parameter2?]);
RegCloseKey(hKey);
Please tell me what I should put in the place of [code?], [parameter1?] and [parameter2?]
please do not advice me to use this or use that, if you want to help me just complete the code above.
Thank you VERY much for you help