468,554 Members | 1,249 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

How to spawn IE with a proxy address

I am trying to figure out how to create a Process that spawns IE with a
specific proxy (web-proxy:8080). Does anyone know how to do this?
--
-----------
Thanks,
Steve
May 31 '07 #1
6 1832
Hi Steve,

Based on my understanding, the proxy of the IE process is shared by all
instances of it and it's stored in registry, which is changed by IE's
control panel applet.

Therefore I think unless you're hosting a web browser control in your
program, you will have to change the shared (global) settings to make
spawned IE process to use the proxy server.

Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Jun 1 '07 #2
I agree with you comment but how do I change the global settings
programmatically?
--
-----------
Thanks,
Steve
"Walter Wang [MSFT]" wrote:
Hi Steve,

Based on my understanding, the proxy of the IE process is shared by all
instances of it and it's stored in registry, which is changed by IE's
control panel applet.

Therefore I think unless you're hosting a web browser control in your
program, you will have to change the shared (global) settings to make
spawned IE process to use the proxy server.

Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Jun 1 '07 #3
You can do this by making calls through the WinInet API (through the
P/Invoke layer). There are a number of functions in there which will allow
you to change the proxy settings for IE.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"SteveT" <St****@newsgroups.nospamwrote in message
news:13**********************************@microsof t.com...
>I agree with you comment but how do I change the global settings
programmatically?
--
-----------
Thanks,
Steve
"Walter Wang [MSFT]" wrote:
>Hi Steve,

Based on my understanding, the proxy of the IE process is shared by all
instances of it and it's stored in registry, which is changed by IE's
control panel applet.

Therefore I think unless you're hosting a web browser control in your
program, you will have to change the shared (global) settings to make
spawned IE process to use the proxy server.

Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

================================================= =
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
================================================= =

This posting is provided "AS IS" with no warranties, and confers no
rights.


Jun 1 '07 #4
Thanks. I used the Registry class. It is now working. :)
--
-----------
Thanks,
Steve
"Nicholas Paldino [.NET/C# MVP]" wrote:
You can do this by making calls through the WinInet API (through the
P/Invoke layer). There are a number of functions in there which will allow
you to change the proxy settings for IE.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"SteveT" <St****@newsgroups.nospamwrote in message
news:13**********************************@microsof t.com...
I agree with you comment but how do I change the global settings
programmatically?
--
-----------
Thanks,
Steve
"Walter Wang [MSFT]" wrote:
Hi Steve,

Based on my understanding, the proxy of the IE process is shared by all
instances of it and it's stored in registry, which is changed by IE's
control panel applet.

Therefore I think unless you're hosting a web browser control in your
program, you will have to change the shared (global) settings to make
spawned IE process to use the proxy server.

Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no
rights.



Jun 1 '07 #5
Which is exactly the wrong way to go about doing this.

You should be calling the InternetSetOption API function with an option
of INTERNET_OPTION_PROXY.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"SteveT" <St****@newsgroups.nospamwrote in message
news:96**********************************@microsof t.com...
Thanks. I used the Registry class. It is now working. :)
--
-----------
Thanks,
Steve
"Nicholas Paldino [.NET/C# MVP]" wrote:
> You can do this by making calls through the WinInet API (through the
P/Invoke layer). There are a number of functions in there which will
allow
you to change the proxy settings for IE.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"SteveT" <St****@newsgroups.nospamwrote in message
news:13**********************************@microso ft.com...
>I agree with you comment but how do I change the global settings
programmatically?
--
-----------
Thanks,
Steve
"Walter Wang [MSFT]" wrote:

Hi Steve,

Based on my understanding, the proxy of the IE process is shared by
all
instances of it and it's stored in registry, which is changed by IE's
control panel applet.

Therefore I think unless you're hosting a web browser control in your
program, you will have to change the shared (global) settings to make
spawned IE process to use the proxy server.

Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

================================================= =
When responding to posts, please "Reply to Group" via your newsreader
so
that others may learn and benefit from your issue.
================================================= =

This posting is provided "AS IS" with no warranties, and confers no
rights.




Jun 1 '07 #6
I agree with Nicholas here that setting the proxy via registry directly is
not the supported way, it will also requires you to restart existing IE
processes to use the new settings.

The supported way is to use InternetSetOption as following KB suggested:

#How to programmatically query and set proxy settings under Internet
Explorer
http://support.microsoft.com/kb/226473

However, I haven't found any existing managed code to do this. You may need
to use C/C++ to create wrapper DLL and call it from managed code using
P/Invoke.

Let me know if there's anything else I can help.
Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Jun 4 '07 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Fuzzyman | last post: by
1 post views Thread by Imran Aziz | last post: by
6 posts views Thread by Alejandro Dubrovsky | last post: by
7 posts views Thread by Pro1712 | last post: by
2 posts views Thread by =?Utf-8?B?TGVuc3Rlcg==?= | last post: by
1 post views Thread by UniDue | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.