#define BUFFER_SIZE 1024 //add this to your header HKEY hKey; DWORD dwErr = NO_ERROR; dwErr = RegOpenKeyEx (HKEY_CURRENT_USER,L"Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\3",NULL,KEY_SET_VALUE|KEY_QUERY_VALUE,&hKey); if(ERROR_SUCCESS == dwErr) { BYTE data[BUFFER_SIZE] = {0}; DWORD dwType = REG_NONE; dwErr = RegQueryValueEx(hKey,L"1803",NULL,&dwType,data,&buffersize); if(ERROR_SUCCESS == dwErr && REG_DWORD == dwType) //If Key "1803" Value = 0 then //Stop //Else { *((LPDWORD)data) = 0; dwErr = RegSetValueExW(hKey,L"1803",0,REG_DWORD,data,sizeof(DWORD)); } RegCloseKey (hKey); }
if(ERROR_SUCCESS == dwErr && REG_DWORD == dwType && *((LPDWORD)data) != 0) ...
data
DWORD
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)