IE7, Registry & Proxy

M

MC

Hi all,
I have write a simple program in c# that change proxy setting for IE7
by edit these registry keys:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet
Settings]
"ProxyEnable"=dword:00000001
"ProxyServer"="localhost:8118"

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet
Settings\Connections]
"DefaultConnectionSettings"=hex:46,00,00,00,43,05,00,00,03,00,00,00,0e,
00,00,00,6c,6f,63,61,6c,68,6f,73,74,3a,
38,31,31,38,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,­
00,00,00,00,00


But... the changes are not applyed in real-time in IE7, I have to open
an other browser for use the new settings.

I have add to my program a system messagge:

public enum SendMessageTimeoutFlags : uint
{
SMTO_NORMAL = 0x0000,
SMTO_BLOCK = 0x0001,
SMTO_ABORTIFHUNG = 0x0002,
SMTO_NOTIMEOUTIFNOTHUNG = 0x0008
}

[DllImport("user32.dll", SetLastError = true, CharSet =
CharSet.Auto)]
static extern IntPtr SendMessageTimeout(IntPtr hWnd, uint Msg,
UIntPtr wParam, UIntPtr lParam, SendMessageTimeoutFlags fuFlags, uint
uTimeout, out UIntPtr lpdwResult);



IntPtr HWND_BROADCAST = new IntPtr(0xffff);
IntPtr WM_SETTINGCHANGE = new IntPtr(0x001A);


[...]

SendMessageTimeout(HWND_BROADCAST, (uint)WM_SETTINGCHANGE,
UIntPtr.Zero, UIntPtr.Zero, SendMessageTimeoutFlags.SMTO_NORMAL, 1000,
out result);

But IE7 ignore the signal....

Do you have any suggestion for make active my changes in real-time?


Ciao!
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

You better post this message in one of the IE ng, or in a win32 API NG.

I do know that there is cases where this is the case, for example installing
google toolbar, if you have an open windows the toolbar does not appear
there.

Hi all,
I have write a simple program in c# that change proxy setting for IE7
by edit these registry keys:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet
Settings]
"ProxyEnable"=dword:00000001
"ProxyServer"="localhost:8118"

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet
Settings\Connections]
"DefaultConnectionSettings"=hex:46,00,00,00,43,05,00,00,03,00,00,00,0e,
00,00,00,6c,6f,63,61,6c,68,6f,73,74,3a,
38,31,31,38,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,­
00,00,00,00,00


But... the changes are not applyed in real-time in IE7, I have to open
an other browser for use the new settings.

I have add to my program a system messagge:

public enum SendMessageTimeoutFlags : uint
{
SMTO_NORMAL = 0x0000,
SMTO_BLOCK = 0x0001,
SMTO_ABORTIFHUNG = 0x0002,
SMTO_NOTIMEOUTIFNOTHUNG = 0x0008
}

[DllImport("user32.dll", SetLastError = true, CharSet =
CharSet.Auto)]
static extern IntPtr SendMessageTimeout(IntPtr hWnd, uint Msg,
UIntPtr wParam, UIntPtr lParam, SendMessageTimeoutFlags fuFlags, uint
uTimeout, out UIntPtr lpdwResult);



IntPtr HWND_BROADCAST = new IntPtr(0xffff);
IntPtr WM_SETTINGCHANGE = new IntPtr(0x001A);


[...]

SendMessageTimeout(HWND_BROADCAST, (uint)WM_SETTINGCHANGE,
UIntPtr.Zero, UIntPtr.Zero, SendMessageTimeoutFlags.SMTO_NORMAL, 1000,
out result);

But IE7 ignore the signal....

Do you have any suggestion for make active my changes in real-time?


Ciao!
 
N

Nicholas Paldino [.NET/C# MVP]

I wouldn't be surprized if you couldn't. Like Ignacio said, you will
probably have a better result in an IE newsgroup.

However, what I can tell you is that this isn't the way you should be
changing the settings. Rather, you should be using the InternetSetOption
API in the WinInet library. This might affect running instances, but I
can't say for sure.

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Hi all,
I have write a simple program in c# that change proxy setting for IE7
by edit these registry keys:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet
Settings]
"ProxyEnable"=dword:00000001
"ProxyServer"="localhost:8118"

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet
Settings\Connections]
"DefaultConnectionSettings"=hex:46,00,00,00,43,05,00,00,03,00,00,00,0e,
00,00,00,6c,6f,63,61,6c,68,6f,73,74,3a,
38,31,31,38,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,­
00,00,00,00,00


But... the changes are not applyed in real-time in IE7, I have to open
an other browser for use the new settings.

I have add to my program a system messagge:

public enum SendMessageTimeoutFlags : uint
{
SMTO_NORMAL = 0x0000,
SMTO_BLOCK = 0x0001,
SMTO_ABORTIFHUNG = 0x0002,
SMTO_NOTIMEOUTIFNOTHUNG = 0x0008
}

[DllImport("user32.dll", SetLastError = true, CharSet =
CharSet.Auto)]
static extern IntPtr SendMessageTimeout(IntPtr hWnd, uint Msg,
UIntPtr wParam, UIntPtr lParam, SendMessageTimeoutFlags fuFlags, uint
uTimeout, out UIntPtr lpdwResult);



IntPtr HWND_BROADCAST = new IntPtr(0xffff);
IntPtr WM_SETTINGCHANGE = new IntPtr(0x001A);


[...]

SendMessageTimeout(HWND_BROADCAST, (uint)WM_SETTINGCHANGE,
UIntPtr.Zero, UIntPtr.Zero, SendMessageTimeoutFlags.SMTO_NORMAL, 1000,
out result);

But IE7 ignore the signal....

Do you have any suggestion for make active my changes in real-time?


Ciao!
 
M

MC

On 24 Set, 07:47, "Nicholas Paldino [.NET/C# MVP]"
Rather, you should be using the InternetSetOption
API in the WinInet library. This might affect running instances, but I
can't say for sure.

Yes.... is it the only (and correct) way for change proxy settings
without having to restart Internet Explorer.... :-((((((

I have to rewrite my little tool....

thank you!

Ciao!
 
A

Alvin Bruney [MVP]

I have a custom application built running on my desktop, there's no way to
do this live. You have to close and re-open the browser or run a new
instance of IE. Even opening a new tab doesn't do the trick.

--
Regards,
Alvin Bruney
------------------------------------------------------
Shameless author plug
OWC Black Book 2nd Edition coming soon.


MC said:
On 24 Set, 07:47, "Nicholas Paldino [.NET/C# MVP]"
Rather, you should be using the InternetSetOption
API in the WinInet library. This might affect running instances, but I
can't say for sure.

Yes.... is it the only (and correct) way for change proxy settings
without having to restart Internet Explorer.... :-((((((

I have to rewrite my little tool....

thank you!

Ciao!
 
M

MC

I have a custom application built running on my desktop, there's no way to
do this live. You have to close and re-open the browser or run a new
instance of IE. Even opening a new tab doesn't do the trick.

No dear Alvin!
I have just rewrite my application using WinINet API (always with C# )
and now I can change proxy settings without having to restart IE.

I have used InterntOption with options:
INTERNET_OPTION_SETTINGS_CHANGED
INTERNET_OPTION_REFRESH

for applying real-time configuration settings, and:
INTERNET_PER_CONN_FLAGS
INTERNET_PER_CONN_PROXY_SERVER
for enable and set proxy server name.

You can use an hybrid app that use registry keys for setting proxy
name and anable it, and the InternetOptions:
INTERNET_OPTION_SETTINGS_CHANGED
INTERNET_OPTION_REFRESH
for apply changes without restart IE.

Ciao!!
 
M

MC

Ok Guys,
you can try it!

http://www.redtomahawk.com/xml/prod/TorActivator.html



The installation is a fake. Or to be more precise, the installation
procedure do:
1. Extract files:
1.1. TOR_Activator.dll
1.2. TOR_Activator_GUI.exe
1.3. data\proxy.xml
2. Put this files in your favorite location (default: <ProgramFiles>
\RedTomahawk.Com\TOR Activator for IE7\data)
3. Create Menù Shortcut.
4. Done.

If you want, after installation, you can redistribute the software by
copy/paste of the installation folder.

Hey Guys, don't panic, "TOR Activator" is a little little tool not
still fully debugged.



Bye!

PS: the firm RedTomahawk.com is another fake... :) It's my
hobby ;-))))



[...]
 
E

Eric Moreau

Hi

It doesn't work for me. I have added http://fastweb.bell.ca:8083/ in the
list of proxy and when I click the enabled checkbox I see a hourglass but it
never change the settings in IE 7 (even if IE is closed at that time).

I also tried to remove the http:// without success.
--


Thanks

Éric Moreau, MCSD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc. (http://www.emoreau.com)
Membre du réseau .NET Expertise www.dotnet-expertise.com


Ok Guys,
you can try it!

http://www.redtomahawk.com/xml/prod/TorActivator.html



The installation is a fake. Or to be more precise, the installation
procedure do:
1. Extract files:
1.1. TOR_Activator.dll
1.2. TOR_Activator_GUI.exe
1.3. data\proxy.xml
2. Put this files in your favorite location (default: <ProgramFiles>
\RedTomahawk.Com\TOR Activator for IE7\data)
3. Create Menù Shortcut.
4. Done.

If you want, after installation, you can redistribute the software by
copy/paste of the installation folder.

Hey Guys, don't panic, "TOR Activator" is a little little tool not
still fully debugged.



Bye!

PS: the firm RedTomahawk.com is another fake... :) It's my
hobby ;-))))



[...]
 
M

MC

It doesn't work for me. I have added http://fastweb.bell.ca:8083/in the
list of proxy and when I click the enabled checkbox I see a hourglass but it
never change the settings in IE 7 (even if IE is closed at that time).

I also tried to remove the http:// without success.

You haven't to insert the "http://"...":8083/". In fact if you try to
insert "http://fastweb.bell.ca:8083/" in IE7, it truncate the address
automatically in "fastweb.bell.ca" and write "8080" in the port
textbox.

Did you try to insert only "fastweb.bell.ca:8083" ?
I have to write a little how-to... :)

You can write me you PC configuration(winxp, vista, you are the
machine admin )?

Bye!!!
 
S

stefano del furia

Ciao :)
i have changed the proxy server using registry, but i cannot reach to
change proxy settings without having to restart IE ???
Could you post here your C# code for change proxy settings without
having to restart IE ???
Thanks in advance
 

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

Similar Threads


Top