Last active
August 20, 2016 17:36
-
-
Save billagee/2267093 to your computer and use it in GitHub Desktop.
VS 2008 example of using SHDocVw.ShellWindows and SHDocVw.IWebBrowser2 in C#
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Using SHDocVw.ShellWindows and SHDocVw.IWebBrowser2 in C# | |
// | |
// VS 2008 edition! | |
// | |
// To do this you must add a reference to the COM component | |
// named "Microsoft Internet Controls" (AKA SHDocVw) | |
SHDocVw.ShellWindows shellWindows = new SHDocVw.ShellWindowsClass(); | |
foreach (SHDocVw.IWebBrowser2 ie in shellWindows) | |
{ | |
Console.WriteLine("ie.LocationURL: " + ie.LocationURL); | |
if (ie.LocationURL.Contains("foo.com")) | |
ie.Quit(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment