
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