HKEY hKey; DWORD buffersize = 1024; DWORD dwErr = NO_ERROR; #define BUFFER_SIZE 1024 dwErr = RegOpenKeyEx (HKEY_CURRENT_USER,"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 = RegQueryValueExW(hKey,L"1803",NULL,&dwType,data,&buffersize); if(ERROR_SUCCESS == dwErr && REG_DWORD == dwType) { *((LPDWORD)data) = 3; //0 is Enable 3 is Disable dwErr = RegSetValueExW(hKey,L"1803",0,REG_DWORD,data,sizeof(DWORD)); } RegCloseKey (hKey); }
Randor
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)