Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB.NET
|
VB.NET General VB.NET discussions for issues that don't fall into other VB.NET forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 7th, 2006, 07:55 PM
Registered User
 
Join Date: Dec 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to cschene
Default How do I obtain a SHDocVw.InternetExplorer

Hi,

In this code I create an IE and call up a web page. I have the process ID and the SHDocVw.WebBrowser for the IE.

How can I get the SHDocVw.InternetExplorer?


        protected virtual void StartBrowserInSeparateTask()
        {
            System.Diagnostics.Process procId;
            //procId = System.Diagnostics.Process.Start("C:\\Program Files\\Internet Explorer\\IEXPLORE.EXE");
            procId = System.Diagnostics.Process.Start("IEXPLORE.EXE");
            // for every shell/browser
            SHDocVw.ShellWindows shellWindows = new SHDocVw.ShellWindows();
            SHDocVw.InternetExplorer browser;
            foreach (SHDocVw.WebBrowser webBrowser in shellWindows)
            {
                uint dwPID;
                if (!webBrowser.FullName.ToLower().Contains("iexplore .exe"))
                {
                    Debug.WriteLine(string.Format(" {0} is not a web browser", webBrowser.FullName));
                    continue;
                }
                Carefx.Tools.Win32Api.GetWindowThreadProcessId(new IntPtr(webBrowser.HWND), out dwPID);
                if (dwPID == procId.Id)
                {
                    // if the document is not ready, go on to the next
                    while (webBrowser.ReadyState != SHDocVw.tagREADYSTATE.READYSTATE_COMPLETE)
                    {
                        Thread.Sleep(200);
                    }
                    //this.browser = webBrowser;
                }
            }

        }
 
Old December 8th, 2006, 07:14 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

This is a VB forum, you know... (But who knows, someone might know...)
 
Old December 8th, 2006, 07:29 PM
Registered User
 
Join Date: Dec 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to cschene
Default

I realized that after I posted.

But .net is pretty much the same in VB and C#.





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to obtain fields of a certain table? MTLedari ASP.NET 2.0 Professional 2 September 27th, 2007 03:56 PM
Obtain Primary IPAddress acuze C# 2005 0 July 27th, 2006 12:33 AM
Controlling InternetExplorer jamie_t VB How-To 2 March 15th, 2005 07:22 AM
SHDOCVW giving error on compiled run WarriorKing Pro VB 6 3 December 20th, 2004 12:10 PM
Silent SHDocVw.InternetExplorer Jenda Pro VB 6 0 August 31st, 2004 12:22 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.