I have a Delphi application that communicates with web servers on the Internet using the Indy components. Most users of the application have direct Internet connections but some are behind a proxy server of a local network. I don't want to have to ask the users to lookup their proxy server in the Internet Options / Connections / LAN Settings dialog
alt text http://toybase.files.wordpress.com/2008/11/ie-proxy-settings.png
as quite frankly most people won't know or care what this setting is.
Can I get this information via some system calls from a Delphi-7 appplication?
Many thanks!
Here's another method that I use, which doesn't require direct registry access. This works under D2007, but I can't see why it wouldn't work under D7.
The Delphi code for Kornel Kisielewicz's answer:
Via WinAPI -- WinHttpGetIEProxyConfigForCurrentUser. You gotta love MS's long WINAPI names ^_^.
After OP edit: You can read from the registry, AFAIR it would be located here :
You would have to get the proxy setting from the browser, which could be in several different locations depending on the browser in use.
You might consider looking into Web Proxy Autodiscovery Protocol, which automatically detects proxy settings on a network.