hey guys finally i got solution.
#include "stdafx.h"
//#include <winreg.h>
#include<windows.h>
#include<string>
bool function();
int _tmain(int argc, _TCHAR* argv[])
{
if (function())
{
printf("hi");
}
}
bool function()
{
HKEY hKey;
LPCTSTR subKey;
LPCTSTR subValue;
HKEY resKey;
DWORD dataLen;
hKey = HKEY_LOCAL_MACHINE;
subKey = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\WindowsUpdate\\Auto Update\\RebootRequired";
long key = RegOpenKeyExA(hKey, subKey, 0, KEY_READ | KEY_WRITE, &resKey);
if (key == ERROR_SUCCESS)
{
printf("sucess");
}
else
{
printf("registry not present");
return false;
}
}</string></windows.h></winreg.h>