Einzelnen Beitrag anzeigen

Benutzerbild von GPRSNerd
GPRSNerd

Registriert seit: 30. Dez 2004
Ort: Ruhrpott
239 Beiträge
 
Delphi 10.4 Sydney
 
#4

Re: GetProxyInformation unter Delphi 2009

  Alt 17. Mär 2009, 15:52
Sorry, my bad.
In ersten Post meinte ich natürlich InternetQueryOptionW und nicht GetProxyInformationW.

In der Kern-Funktion GetProxyInformation ist nicht viel zum Umstellen auf Widestring etc.:
Delphi-Quellcode:
function GetProxyInformation: WideString;
var
  ProxyInfo: PInternetProxyInfo;
  Len: LongWord;
begin
  Result := '';
  Len := 4096;
  GetMem(ProxyInfo, Len);
  try
    if InternetQueryOptionW(nil, INTERNET_OPTION_PROXY, ProxyInfo, Len) then
      if ProxyInfo^.dwAccessType = INTERNET_OPEN_TYPE_PROXY then
      begin
        Result := ProxyInfo^.lpszProxy;
      end;
  finally
    FreeMem(ProxyInfo);
  end;
  //ShowMessage(result);
end;
Der Output mit dem Showmessage am Ende ergibt zig nicht darstellbare Zeichen.
Stefan
  Mit Zitat antworten Zitat