The code here simply set EnableProxy property to checked on Control Panel like below

The below is the actual code in Delphi

enable_proxy.pas
uses System.Win.Registry;


procedure EnableProxy;
var
  myReg: TRegistry;
begin
  myReg := TRegistry.Create( KEY_SET_VALUE);
  try
    myReg.RootKey := HKEY_CURRENT_USER; // or HKEY_LOCAL_MACHINE
    if myReg.OpenKey('Software\Microsoft\Windows\CurrentVersion\Internet Settings\', true) then
    try
      myReg.WriteInteger('ProxyEnable', $00000001);
    finally
      myReg.CloseKey;
    end;
  finally
    myReg.Free;
  end;
  Close;
end;

IPorxyAutoReset.zipIPorxyAutoReset_src.zip