#include <stdio.h>
#include <windows.h>
int main()
{
LONG result;
result = RegDeleteKeyValue(HKEY_LOCAL_MACHINE,L"/SOFTWARE/MYKEY",L"VALUE");
LPVOID lpMsgBuf;
FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
result,
0,
(LPTSTR) &lpMsgBuf,
0,
NULL
);
MessageBox( NULL, (LPCTSTR)lpMsgBuf, L"Error", MB_OK | MB_ICONINFORMATION );
LocalFree( lpMsgBuf );
return 0;
}