468,110 Members | 1,595 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,110 developers. It's quick & easy.

IE7, Registry & Proxy

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\Curre ntVersion\Internet
Settings]
"ProxyEnable"=dword:00000001
"ProxyServer"="localhost:8118"

[HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\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,0 0,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!

Sep 24 '07 #1
12 6764
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.

"MC" <no*****@gmail.comwrote in message
news:11**********************@w3g2000hsg.googlegro ups.com...
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\Curre ntVersion\Internet
Settings]
"ProxyEnable"=dword:00000001
"ProxyServer"="localhost:8118"

[HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\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,0 0,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!
Sep 24 '07 #2
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]
- mv*@spam.guard.caspershouse.com

"MC" <no*****@gmail.comwrote in message
news:11**********************@w3g2000hsg.googlegro ups.com...
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\Curre ntVersion\Internet
Settings]
"ProxyEnable"=dword:00000001
"ProxyServer"="localhost:8118"

[HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\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,0 0,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!
Sep 24 '07 #3
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!


Sep 24 '07 #4
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" <no*****@gmail.comwrote in message
news:11**********************@57g2000hsv.googlegro ups.com...
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!


Sep 25 '07 #5
MC
On 24 Set, 17:25, "Alvin Bruney [MVP]" <some guy without an email
addresswrote:
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!!

Sep 25 '07 #6
Hi

Is your tool available?

I have the same problem.

--
TIA

É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
"MC" <no*****@gmail.comwrote in message
news:11**********************@w3g2000hsg.googlegro ups.com...
On 24 Set, 17:25, "Alvin Bruney [MVP]" <some guy without an email
addresswrote:
>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!!

Sep 25 '07 #7
MC
On 25 Set, 03:08, "Eric Moreau" <eric.moreau_NO_SP...@videotron.ca>
wrote:
Hi
Is your tool available?
;-)

Yes,
but you have to wait a few days for bug fixing.

Ciao!!!!
Sep 25 '07 #8
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 ;-))))

On 25 Set, 12:24, MC <nous...@gmail.comwrote:
[...]

Sep 25 '07 #9
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
"MC" <no*****@gmail.comwrote in message
news:11*********************@n39g2000hsh.googlegro ups.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 ;-))))

On 25 Set, 12:24, MC <nous...@gmail.comwrote:
[...]
Sep 26 '07 #10
MC
On 26 Set, 02:14, "Eric Moreau" <eric.moreau_NO_SP...@videotron.ca>
wrote:
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!!!

Sep 26 '07 #11
MC
On 26 Set, 20:16, MC <nous...@gmail.comwrote:
On 26 Set, 02:14, "Eric Moreau" <eric.moreau_NO_SP...@videotron.ca>
wrote:
It doesn't work
I have verifyed... it is a bug. try to insert only: fastweb.bell.ca:
8083

Sep 26 '07 #12

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
*** Sent via Developersdex http://www.developersdex.com ***
Oct 2 '07 #13

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Alexandr Molochnikov | last post: by
4 posts views Thread by sonic_soul | last post: by
1 post views Thread by Zürcher See | last post: by
4 posts views Thread by Sharon | last post: by
Kevinyy
reply views Thread by Kevinyy | last post: by
hsn
reply views Thread by hsn | last post: by
1 post views Thread by Solo | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.