⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 connect to internet explorer instances.txt

📁 关于ie控制的编程各种方面的内容和源代码
💻 TXT
字号:
Connect to Internet Explorer Instances, From your own Process. 

--------------------------------------------------------------------------------
This article was contributed by Venu Vemula & Robert Walker. 
There has been always a problem connecting to web browsers, Either you need to write Browser Helper Object or something which browser needs to instantiate. But I found all the other methods had one or other way bug in it. Decided to find simple and bug free way, And came across this ShellWindows interface, which is used by Shell to keep track all the shell browsers including Shell Folders and Internet explorers I Believe shell uses name spaces to keep track of this windows. 

Not only shell windows keeps track of all shell windows and also notifies when new shell window is created or deleted. 

When you enumerate, you can query whether the entry supports IWebBrowser interface, if it does it could be either WebBrowser or ShellBrowser. Once you get hold of IWebBrowser2 interface, you can either use it or listen to DWebBrowserEvents or through it away. 

Before you start cranking in, you should include 

#import "mshtml.tlb": // Internet Explorer 5
#import "shdocvw.dl"

Connecting To web browser using shell windows interface 

void CIEEnumWindowsDlg::ConnectToShell() 
{
 CoInitialize(NULL);

 if(m_spSHWinds == 0) {
  //
  // Get reference to ShellWindows interface
  //
  if(m_spSHWinds.CreateInstance(__uuidof(SHDocVw::ShellWindows)) 
  == S_OK) {
   // Event Sink 
   //
   LPCONNECTIONPOINTCONTAINER pConnPtCont;

   if ((m_spSHWinds != NULL) && 
   SUCCEEDED(m_spSHWinds->QueryInterface(IID_IConnectionPointContainer,
                                         (LPVOID*)&pConnPtCont))) {
    ASSERT(pConnPtCont != NULL);
    LPCONNECTIONPOINT pConnPt = NULL;
    DWORD dwCookie = 0;

    if (SUCCEEDED(pConnPtCont->FindConnectionPoint(
     __uuidof(SHDocVw::DShellWindowsEvents), &pConnPt)))
    {
     ASSERT(pConnPt != NULL);
     pConnPt->Advise( this->GetIDispatch(FALSE), &dwCookie);
     pConnPt->Release();
    }

    pConnPtCont->Release();
   }
  }
  else {
   AfxMessageBox("Shell Windows interface is not avilable");
  }
 }
}

Downloads
Download source - 15 Kb 
History
Date Posted: June 1, 2000
Date Updated: January 16, 2000 
Comments:
maximizing IE instance - Mahesh (2001/05/28) 
Parsing HTML tags from a running IE instance. - Jackson Lai (2001/05/21) 
Great..... - Onkar Singh (2001/04/17) 
new ie instance - yuan yunchang (2001/03/30) 
Thank you for such a nice thing. - Niranjan Kulkarni (2001/03/16) 
Add Comment 






maximizing IE instance

--------------------------------------------------------------------------------
This article is really helpful. 
On the same line I need your help. 
I am able to connect to the running instance of IE and also able to change its URL. 
But if the IE instance is minimized then how can I Maximize it? 

Submitted By: Mahesh (2001/05/28) 
Go up a level 





Parsing HTML tags from a running IE instance. 

--------------------------------------------------------------------------------
My application would like to connect to a running instance of IE and then parse the whole HTML document so that I will get a list of URL links (href) and other objects such as textboxes and images. Is it possible to achieve this? 
Thank you very much. 

Submitted By: Jackson Lai (2001/05/21) 




Great.....

--------------------------------------------------------------------------------

This code gives enough information to do some really serious work. Thanks....


Regards,
Onkar Singh
http://thedevelopers.faithweb.com

Submitted By: Onkar Singh (2001/04/17) 





Thank you for such a nice thing.

--------------------------------------------------------------------------------
The code that is given is really a helpful one and I got a very big advantage from that. Thank you for the programmers who put the code on code guru. I am very very thankful to them. 
Submitted By: Niranjan Kulkarni (2001/03/16) 






⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -