Eric
Eric

Reputation: 31

How to get WinInet's proxy settings quickly (without network dependency)

How can I quickly retrieve Internet Explorer's proxy settings from C++?

The windows function WinHTTPGetIEProxyConfigForCurrentUser() gives me exactly what I want.

The problem with WinHTTPGetIEProxyConfigForCurrentUser() is it is running unacceptably slowly on some of my user's systems (they are running Windows 7). For these users, the function takes multiple seconds to complete. It seems to have a networking dependency, since if they unplug the network cable the function returns fast (and with the same result).

So how can I get the system proxy settings without this slow network dependency?

Thanks!

Upvotes: 3

Views: 3994

Answers (2)

EricLaw
EricLaw

Reputation: 57085

Poking the registry directly isn't supported. The proper mechanism to get the IE's proxy settings is to call InternetQueryOptionList with the INTERNET_OPTION_PER_CONNECTION_OPTION structure and the appropriate flags for what you need.

Upvotes: 4

ta.speot.is
ta.speot.is

Reputation: 27214

Retrieve these details from the registry. The registry keys are mentioned here: http://support.microsoft.com/kb/819961/EN-US

Upvotes: 0

Related Questions