thanks for you r help.. what could it be that the value isnt deleted? i have created the value manually in the registry for testing purposes and when i run my program the value still remains.
here is my complete code:
#include <stdio.h>
#include <tchar.h>
#include <windows.h>
int _tmain(int argc, _TCHAR* argv[])
{
CHAR strLong[1024];
LONG result;
result = RegDeleteKeyValue(HKEY_LOCAL_MACHINE,L"SOFTWARE\\MYKEY\\",L"VALUE");
printf(strLong, "%s", result);
printf("\n");
system("Pause");
return 0;
}
thanks in advance for any help
edit:
i tried another way
#include <stdio.h>
#include <windows.h>
int main()
{
HKEY hkey;
LONG result;
result = RegOpenKey(HKEY_LOCAL_MACHINE, L"SOFTWARE\\MYKEY", &hkey);
if(result==ERROR_SUCCESS) printf("key opened");
RegDeleteValue(hkey, L"VALUE");
RegCloseKey(hkey);
system("Pause");
return 0;
}
it seems that the key isnt even opened as the printf is not called.
any ideas??