Getting URL of an instance of IE 
Author Message
 Getting URL of an instance of IE

I am trying to get the URL from a given instance of Internet Explorer.
Preferably using C# but whatever works.  I can get the title and handles of
each instance but dont' know how to get the URL of any given instance.

I would GREATLY appreciate an example/clue/etc.  I am on my last nerve over
this  :)

Thanks for your time,

Jim



Mon, 28 Mar 2005 15:41:51 GMT  
 Getting URL of an instance of IE
Hello,

The following is a sample in VB6.

Q176792 HOWTO: Connect to a Running Instance of Internet Explorer
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q176792

In the sample, it has the code to determine whether it's an HTML page.
         If TypeOf Doc Is HTMLDocument Then
            'if this is an HTML page, display the title
            'may or may not be the same as LocationName
            List2.AddItem Doc.Title
         End If

If it's an HTML page, you can call Doc.Location to get the URL.

You can do the similar job in .NET.

Best Regards,  
Kenny Zhou
Microsoft Support

This posting is provided "AS IS" with no warranties, and confers no rights.
Got .Net?  http://www.gotdotnet.com



Tue, 29 Mar 2005 17:39:25 GMT  
 Getting URL of an instance of IE
If I had a newborn he/she would be yours!  :)  You just made my week.  If
anyone would like to see what it lookslike in C# here is the base code that
u need.  Again THANKS.

//be sure to add these
using SHDocVw;
using mshtml;

SHDocVw.ShellWindows SWs = new SHDocVw.ShellWindowsClass();
SHDocVw.InternetExplorer IE = new SHDocVw.InternetExplorerClass();

private System.Windows.Forms.ListBox listBox1;

//foreach window of IE that is running//
foreach (SHDocVw.InternetExplorer IE in SWs)
{
//add the URL to the listbox//
//should do an if statement to weed out any that aren't set to a location//
 listBox1.Items.Add(IE.LocationURL);

Quote:
}



Quote:
> Hello,

> The following is a sample in VB6.

> Q176792 HOWTO: Connect to a Running Instance of Internet Explorer
> http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q176792

> In the sample, it has the code to determine whether it's an HTML page.
>          If TypeOf Doc Is HTMLDocument Then
>             'if this is an HTML page, display the title
>             'may or may not be the same as LocationName
>             List2.AddItem Doc.Title
>          End If

> If it's an HTML page, you can call Doc.Location to get the URL.

> You can do the similar job in .NET.

> Best Regards,
> Kenny Zhou
> Microsoft Support

> This posting is provided "AS IS" with no warranties, and confers no
rights.
> Got .Net?  http://www.gotdotnet.com



Wed, 30 Mar 2005 03:51:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Who knows ,,, Redirect IE URL as IE

2. ole drag and drop (IE url)

3. HTTP headers and URL of browser instance

4. Get current IE URL

5. Finding the URL of a Frame in IE

6. URL from IE

7. Accept link(URL)-drop(by drag) from IE?

8. Get current URL Netscape & IE

9. HOTO find current URL in IE/Netscape

10. How to get IE URL?

11. Get the current URL Netscape & IE

12. Open the URL in a new IE window

 

 
Powered by phpBB® Forum Software