I thought using RegSaveKeyEx would help me to save a registry subkey as a .REG file, but it is not working. I have this code:
// Saving key
LONG saveKey = RegSaveKeyExW(keyResult, L"C:\\Demo1.reg", securityAttributes, Flags);
There is no Registry API function that will output a key in
.reg format. You will have to enumerate the key's content yourself and write out your own
.reg file manually.