changes on windows registry doesn’t take effect immediately

I

iMath

changes on windows registry doesn’t take effect immediately

I am trying to change IE’s proxy settings by the following 2 code snippets

to enable the proxy by this code

from winreg import *
with OpenKey(HKEY_CURRENT_USER,r"Software\Microsoft\Windows\CurrentVersion\Internet Settings" ,0, KEY_ALL_ACCESS) as key:
SetValueEx(key,"ProxyServer",0, REG_SZ, "127.0.0.1:8087")
SetValueEx(key,"ProxyEnable",0, REG_DWORD, 1)
SetValueEx(key,"ProxyOverride",0, REG_SZ, "<local>")
FlushKey(key)

to disable the proxy by this code

from winreg import *
with OpenKey(HKEY_CURRENT_USER,r"Software\Microsoft\Windows\CurrentVersion\Internet Settings" ,0, KEY_ALL_ACCESS) as key:

DeleteValue(key,"ProxyServer")
SetValueEx(key,"ProxyEnable",0, REG_DWORD, 0)
DeleteValue(key,"ProxyOverride")
FlushKey(key)

but the changes on windows registry doesn’t take effect immediately,so isthere some way to change the windows registry and let the changes take effect immediately without restarting IE ?

BTW ,I use the code on winxp ,and I am going to embed the 2 code snippets in my PyQt application .
 
S

Steven D'Aprano

changes on windows registry doesn’t take effect immediately

I am trying to change IE’s proxy settings by the following 2 code
snippets [...]
but the changes on windows registry doesn’t take effect immediately,so
is there some way to change the windows registry and let the changes
take effect immediately without restarting IE ?

That's an IE question, not a Python question. You might be lucky and have
somebody here happen to know the answer, but you'll probably have more
luck asking on a group dedicated to Windows and IE.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,699
Latest member
AnneRosen

Latest Threads

Top