Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #41256

changes on windows registry doesn’t take effect immediately

Newsgroups comp.lang.python
Date 2013-03-14 22:26 -0700
Message-ID <8f25a1bd-208a-4521-b233-5e26d802ccac@googlegroups.com> (permalink)
Subject changes on windows registry doesn’t take effect immediately
From iMath <redstone-cold@163.com>

Show all headers | View raw


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 is there 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 .

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

changes on windows registry doesn’t take effect immediately iMath <redstone-cold@163.com> - 2013-03-14 22:26 -0700
  Re: changes on windows registry doesn’t take effect immediately Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-03-15 05:56 +0000
  Re: changes on windows registry doesn’t take effect immediately Tim Roberts <timr@probo.com> - 2013-03-14 23:16 -0700

csiph-web