By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,899 Members | 1,336 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,899 IT Pros & Developers. It's quick & easy.

C#: How to find out IE's URL

P: n/a
BK
Hi all!

I am a total newbie on this stuff and I am probably asking for
an answer for very stupid (simple) problem.
Well..

I would like to write a C# application that checks URLs where
user go/surf by using IE. I found on the internet how to do that
by launching own instance of IE (new InternetExplorer()...) and then
with the help of events in shdocvw.dll I can see where the user is
surfing. This works fine.
But... I have a problem of detecting URLs of the browser that is not
started with my application. How can I find appropriate instance
of the browser and 'connect' to it so that I could know its URL.
I know that by using

System.Diagnostics.Process[] myProcesses =
System.Diagnostics.Process.GetProcesses();

and then traversing through names of the process and searching
for 'iexplore' I can find the process data about the already launched
IE. But what next??

How can I find out at which URL is that alread launched IE?

Please help... I need this quit urgently:(

Regards to all,
Branko

P.S.: Please respond to my e-mail too, because I have difficulties
using news:(

Nov 15 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
You will need to use remoting. Im sorry I dont have to create the
example for you. But here is:

// something like this but you need to take care of remoting issues
// before you can do this.

// remembet that these processes are in different application domains.
ObjRef or = myprocess.CreateObjRef(typeof(AxAxBrowse.AxAxBrows er));

http://xpcoder.net

BK <br***********@email.si> wrote in message news:<bv*********@enews3.newsguy.com>...
Hi all!

I am a total newbie on this stuff and I am probably asking for
an answer for very stupid (simple) problem.
Well..

I would like to write a C# application that checks URLs where
user go/surf by using IE. I found on the internet how to do that
by launching own instance of IE (new InternetExplorer()...) and then
with the help of events in shdocvw.dll I can see where the user is
surfing. This works fine.
But... I have a problem of detecting URLs of the browser that is not
started with my application. How can I find appropriate instance
of the browser and 'connect' to it so that I could know its URL.
I know that by using

System.Diagnostics.Process[] myProcesses =
System.Diagnostics.Process.GetProcesses();

and then traversing through names of the process and searching
for 'iexplore' I can find the process data about the already launched
IE. But what next??

How can I find out at which URL is that alread launched IE?

Please help... I need this quit urgently:(

Regards to all,
Branko

P.S.: Please respond to my e-mail too, because I have difficulties
using news:(

Nov 15 '05 #2

P: n/a
BK
Hi!

I tried the resource from Igor and it worked fine.
For anybody else, in C# it was something like that:

--
ShellWindows SW = new ShellWindowsClass();
string Temp;

foreach (InternetExplorer TempIE in SW)
{
Temp = Path.GetFileNameWithoutExtension(TempIE.FullName). ToLower();
if (Temp.Equals("iexplore"))
{
....
}
}
--
I also had problems when I want to compare two browser instances. Using
method Equals from InternetExplorer was not working in all cases and
then I used comparing via property HWND which works ok.

Thanks!!!

Branko

Coder Coder wrote:
You will need to use remoting. Im sorry I dont have to create the
example for you. But here is:

// something like this but you need to take care of remoting issues
// before you can do this.

// remembet that these processes are in different application domains.
ObjRef or = myprocess.CreateObjRef(typeof(AxAxBrowse.AxAxBrows er));

http://xpcoder.net

BK <br***********@email.si> wrote in message news:<bv*********@enews3.newsguy.com>...
Hi all!

I am a total newbie on this stuff and I am probably asking for
an answer for very stupid (simple) problem.
Well..

I would like to write a C# application that checks URLs where
user go/surf by using IE. I found on the internet how to do that
by launching own instance of IE (new InternetExplorer()...) and then
with the help of events in shdocvw.dll I can see where the user is
surfing. This works fine.
But... I have a problem of detecting URLs of the browser that is not
started with my application. How can I find appropriate instance
of the browser and 'connect' to it so that I could know its URL.
I know that by using

System.Diagnostics.Process[] myProcesses =
System.Diagnostics.Process.GetProcesses();

and then traversing through names of the process and searching
for 'iexplore' I can find the process data about the already launched
IE. But what next??

How can I find out at which URL is that alread launched IE?

Please help... I need this quit urgently:(

Regards to all,
Branko

P.S.: Please respond to my e-mail too, because I have difficulties
using news:(


Nov 15 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.