Считываем настройки прокси из registry

Чотбы получить настроки указваемые windows в свойствах Интернет достаточно считать два ключа в системном реестра текущего пользователя

  "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings"
"ProxyEnable"=dword:00000001
"ProxyServer"=":"
"ProxyOverride"=""
"DisablePasswordCaching"=dword:00000001

На VCL это будет выглядеть так:

Пример:

AnsiString proxyServer;
AnsiString proxyPort;
AnsiString section = "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings";
TRegistryIniFile *regIni = new TRegistryIniFile("");

int proxyEnabled = regIni->ReadInteger(section, "ProxyEnable", 0);
if(proxyEnabled)
{
proxyServer = regIni->ReadString(section,"ProxyServer","");
if(proxyServer.Length())
{
int portPos = proxyServer.LastDelimiter(":");
if(portPos){
proxyPort = proxyServer.SubString(portPos+1, proxyServer.Length()-portPos);
proxyServer = proxyServer.SubString(1, portPos-1);
}
}
}
delete regIni;