Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / November 2006

Tip: Looking for answers? Try searching our database.

Interaction with Microsoft Internet Explorer

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tal Shachar - 04 Nov 2006 07:35 GMT
Hi,
I'm building a windows application that needs to identify if the user has an
opened browser, and if so - get the current open page(s) address.
The problem is that I can get the iexplore.exe process, but I can't find how
to get the address of the web page it currently displays.
Is there an API for the Microsoft Internet Explorer I can use? Does anyone
know how to get this done?
Appreciate all the help I can get.

TIA,
 - Tal.
Mattias Sjögren - 05 Nov 2006 14:25 GMT
>Is there an API for the Microsoft Internet Explorer I can use?

Yes, a COM based one. Reference Shdocvw.dll and look at the
ShellWindows collection.

Mattias

Signature

Mattias Sjögren [C# MVP]  mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

Tal Shachar - 05 Nov 2006 18:46 GMT
Hello Mattias,
Thanks a lot for the reply. I tried to use this class (did you mean the
ShellWindowsClass ? ), but did not understand how can I find the web address
of the open browser. Can you please assist with me directions?

TIA,
 - Tal.

> >Is there an API for the Microsoft Internet Explorer I can use?
>
> Yes, a COM based one. Reference Shdocvw.dll and look at the
> ShellWindows collection.
>
> Mattias
Mattias Sjögren - 05 Nov 2006 23:30 GMT
>Thanks a lot for the reply. I tried to use this class (did you mean the
>ShellWindowsClass ? ), but did not understand how can I find the web address
>of the open browser. Can you please assist with me directions?

Check the LocationURL property.

foreach (InternetExplorer ie in new ShellWindows())
{
    Console.WriteLine(ie.LocationURL);
}

Note that this will also list Explorer windows.

Mattias

Signature

Mattias Sjögren [C# MVP]  mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

Tal Shachar - 06 Nov 2006 17:26 GMT
Mattias,
Thanks a million for that!!! It is exactly what I needed.
Btw, is it an option to know which of the open browsers is the active one or
the last one that the user browsed (not necessarily the last one that was
opened)?
Thanks again, appreciate your help!
 - Tal

> >Thanks a lot for the reply. I tried to use this class (did you mean the
>>ShellWindowsClass ? ), but did not understand how can I find the web
[quoted text clipped - 11 lines]
>
> Mattias

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.