[Disclaimer: this is a Windows 7 specific issue as far as I can tell]
I've got a block of code that changes the proxy settings in the Windows registry, 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 completely fine in XP and Vista, however in Windows 7 something has apparently changed, and for some reason the previous registry keys get injected back in causing it to not work as expected.
If I comment out those two lines of code, the registry values stick, but obviously IE and other applications relying on that proxy information have no idea that the configuration has changed.
Is there a better way to handle notifying the system that the options have changed and need to be reloaded? I have searched for days on this issue, switched compilers, etc., and nothing I do makes it work as I would expect in Windows 7.