So, indem ich den Record auf PAnsiChars umstelle funktionierts:
Delphi-Quellcode:
type
PInternetProxyInfoA = ^INTERNET_PROXY_INFOA;
INTERNET_PROXY_INFOA = record
dwAccessType: DWORD; { dwAccessType - INTERNET_OPEN_TYPE_DIRECT, INTERNET_OPEN_TYPE_PROXY, or }
lpszProxy: PAnsiChar; { lpszProxy - proxy server list }
lpszProxyBypass: PAnsiChar; { lpszProxyBypass - proxy bypass list }
end;
function GetProxyInformation: AnsiString;
var
ProxyInfo: PInternetProxyInfoA;
Len: DWORD;
begin
Result := '';
Len := 4096;
GetMem(ProxyInfo, Len);
try
if InternetQueryOptionW(nil, INTERNET_OPTION_PROXY, ProxyInfo, Len) then
begin
if ProxyInfo^.dwAccessType = INTERNET_OPEN_TYPE_PROXY then
begin
Result := ProxyInfo^.lpszProxy;
end;
end;
finally
FreeMem(ProxyInfo);
end;
end;
Danke an Bernhard und Detlef!