[windev] Unable to query proxy "Automatically Detect Settings" flag on Windows 7 with IE 8
JOHN A V
alappattjohn at yahoo.com
Fri May 7 13:39:25 GMT 2010
Hi All,
I am trying to capture proxy setting
("Automatically Detect Settings"). My code works on XP and Vista.
But it is
NOT working on Windows 7
Please see the details of target
platform
Windows 7 Enterprise, IE 8.0.7600.16385,
Wininet.dll 8.0.7600.16535
Please see the code snippet
INTERNET_PER_CONN_OPTION_LIST List;
INTERNET_PER_CONN_OPTION Option[1];
unsigned long nSize =
sizeof(INTERNET_PER_CONN_OPTION_LIST);
Option[0].dwOption =
INTERNET_PER_CONN_FLAGS;
List.dwSize =
sizeof(INTERNET_PER_CONN_OPTION_LIST);
List.pszConnection =
NULL;
List.dwOptionCount = 1;
List.dwOptionError =
0;
List.pOptions = Option;
if(!InternetQueryOption(NULL,
INTERNET_OPTION_PER_CONNECTION_OPTION, &List, &nSize))
AfxMessageBox(L"InternetQueryOption failed! (%d)\n");
if(Option[0].Value.pszValue != NULL)
AfxMessageBox(Option[0].Value.pszValue);
TCHAR a[100];
swprintf(a, L"Flag value
is : %d",Option[2].Value.dwValue, 80);
AfxMessageBox(a);
But on Windows 7, even if "Automatically Detect
Settings" option in IE is checked, the program says that that flag is not
set
I tried with WinHttp api also as shown below.
WINHTTP_CURRENT_USER_IE_PROXY_CONFIG stProxyConfig
= {0};
WinHttpGetIEProxyConfigForCurrentUser(&stProxyConfig);
if (stProxyConfig.fAutoDetect == TRUE)
AfxMessageBox(L"Auto proxy detection
enabled");
else
AfxMessageBox(L"Auto proxy detection
disabled");
On Windows 7, below code also fails to capture the "Automatically Detect Settings" option
Any inputs on this is highly appreciated.
Thanks
John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.windev.org/pipermail/windev/attachments/20100507/2b565889/attachment.htm
More information about the Windev
mailing list