실행 중인 IE의 리스트 얻는 방법


Connecting to Running Instances of Internet Explorer


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

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");
  }
 }
}

Write your message and submit