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:
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
Code:
#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??

Last edited by ello; 12/04/10 20:41.

www.earthcontrol.de
quoted: We want to maintain a clean, decent, American family suited forum look... which means you may post zombies or chainsaw massacres, but no erotic.