uses wininet;
function ProxyServer(var Proxy: string): boolean;
var
lg: DWord;
IPI: PInternetProxyInfo;
begin
lg := $1000;
GetMem(IPI, lg);
try
if InternetQueryOption(nil, INTERNET_OPTION_PROXY, IPI, lg) and
(IPI^.dwAccessType = INTERNET_OPEN_TYPE_PROXY) then begin
Result := True;
Proxy := IPI^.lpszProxy;
end else Result := False;
finally
FreeMem(IPI);
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
var s: string;
begin
if ProxyServer(s) then
showmessage(s) else
showmessage('kein Proxy');
end;