0

I need to read Windows' network proxy settings programmatically exactly as they are set in the UI. (the devil is in the latter part of that sentence)

I'm fully aware of the Win32 WinHttpGetIEProxyConfigForCurrentUser function and on surface it is exactly what I want but it masks the results of the autoDetect attribute always returning false (at least on Win7) if WPAD fails. Admittedly this is clever, but it is not what I want. For my purpose I need to know what the UI setting is, not a value that has been "resolved" by Windows.

How can I retrieve network proxy configuration (as specified in the UI) in a reliable way across Windows versions since Win 7 ?

peterh
  • 18,404
  • 12
  • 87
  • 115
  • can this link help: http://stackoverflow.com/questions/202547/how-do-i-find-out-the-browsers-proxy-settings – milevyo Oct 19 '15 at 05:37

1 Answers1

1

from registry:

[HCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
ProxyServer=xxx.xxx.xxx.xxx:yyyy (REG_SZ)
ProxyEnable= (REG_DWORD)
milevyo
  • 2,165
  • 1
  • 13
  • 18
  • 1
    Sorry mate, you cannot - AFAIK - find the `autoDetect` flag that way. Also some pointer to docs would be appreciated. How would I know I can use such method reliably on Win7, Win8 and Win10 ? – peterh Oct 19 '15 at 05:13