[Disclaimer: This is a specific Windows 7 issue, as far as I can tell)
I have a block of code that modifies the proxy settings in the Windows registry, and then proceeds to call the WinInet API with the following:
InternetSetOption(NULL, INTERNET_OPTION_SETTINGS_CHANGED, NULL, 0); InternetSetOption(NULL, INTERNET_OPTION_REFRESH , NULL, 0);
This is perfectly normal in XP and Vista, however, something seems to have changed in Windows 7, and for some reason, the previous registry keys are injected back, making it not work as expected.
If I comment on these two lines of code, the registry values will stand up, but, obviously, IE and other applications that rely on this proxy information do not know that the configuration has changed.
Is there a better way to deal with notifying the system that the settings have been changed and need to be reloaded? I searched for days on this issue, switched compilers, etc., And none of this does the job as I would expect in Windows 7.
source share