LRESULT IECommandExecutor::OnNewHtmlDialog(UINT uMsg,
                                           WPARAM wParam,
                                           LPARAM lParam,
                                           BOOL& bHandles) {
  LOG(TRACE) << "Entering IECommandExecutor::OnNewHtmlDialog";

  HWND dialog_handle = reinterpret_cast<HWND>(lParam);
  BrowserMap::const_iterator it = this->managed_browsers_.begin();
  for (; it != this->managed_browsers_.end(); ++it) {
    if (dialog_handle == it->second->window_handle()) {
      LOG(DEBUG) << "Dialog is equal to one managed browser";
      return 0;
    }
  }

  CComPtr<IHTMLDocument2> document;
  if (this->factory_.GetDocumentFromWindowHandle(dialog_handle, &document)) {
    CComPtr<IHTMLWindow2> window;
    document->get_parentWindow(&window);
    this->AddManagedBrowser(BrowserHandle(new HtmlDialog(window,
                                                         dialog_handle,
                                                         this->m_hWnd)));
  } else {
    LOG(WARN) << "Unable to get document from dialog";
  }
  return 0;
}
Esempio n. 2
0
LRESULT IESessionWindow::OnNewHtmlDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandles) {
	HWND dialog_handle = reinterpret_cast<HWND>(lParam);
	CComPtr<IHTMLDocument2> document;
	if (this->factory_.GetDocumentFromWindowHandle(dialog_handle, &document)) {
		IHTMLWindow2* window;
		document->get_parentWindow(&window);
		this->AddManagedBrowser(BrowserHandle(new HtmlDialog(window, dialog_handle, this->m_hWnd)));
	}
	return 0;
}
Esempio n. 3
0
LRESULT IECommandExecutor::OnNewHtmlDialog(UINT uMsg,
                                           WPARAM wParam,
                                           LPARAM lParam,
                                           BOOL& bHandles) {
  HWND dialog_handle = reinterpret_cast<HWND>(lParam);
  BrowserMap::const_iterator it = this->managed_browsers_.begin();
  for (; it != this->managed_browsers_.end(); ++it) {
    if (dialog_handle == it->second->window_handle()) {
      return 0;
    }
  }

  CComPtr<IHTMLDocument2> document;
  if (this->factory_.GetDocumentFromWindowHandle(dialog_handle, &document)) {
    CComPtr<IHTMLWindow2> window;
    document->get_parentWindow(&window);
    this->AddManagedBrowser(BrowserHandle(new HtmlDialog(window,
                                                         dialog_handle,
                                                         this->m_hWnd)));
  }
  return 0;
}