Less
Less

Reputation: 3207

Invalidate Windows registry proxy settings?

I was wondering if this is possible at all... I saw that IE, Chrome/Safari, rely on proxy settings found in the registry, and Mozilla also can use this, if "use system proxy settings" is enabled.

What's the thing that is bugging me?
Maybe I'm wrong, but it seems to me that Chrome, for example, caches this settings in some way. That is, if I programmatically change needed registry entries, the browser may remain unaware of this changes, and it will continue to use old values until I explicitly open options>under the hood>change proxy settings>lan setting, and confirm it with OK button in the dialog. Seems that this is the point where browser reloads proxy settings from the registry.
Am I right about this, and if so, is there any way to make invalidation programmatically? I was messing around with this in my custom C# .net 2.0 application.

Thanks.

Upvotes: 0

Views: 345

Answers (1)

Alex K.
Alex K.

Reputation: 175766

You need to p/invoke InternetSetOption with INTERNET_OPTION_SETTINGS_CHANGED &INTERNET_OPTION_REFRESH (call twice, its not a mask) to notify the system that you have tinkered with the settings.

Upvotes: 4

Related Questions