3

When working on an IE Browser Helper Object, I observed that when calling IWebBrowser2::Navigate2 method with flag navOpenInNewWindow, if its called in BHO's IObjectWithSite::SetSite method, the new tab is open in a new IE window; but if its called in BHO's DWebBrowserEvents2::OnDocumentComplete event handler, the new tab is open in current IE window.

I'd like to open new tab in new window in BHO's DWebBrowserEvents2.OnDocumentComplete event handler. I tried several ways, including assign "_blank" target frame name, and tried IHTMLDocument2.open method (following this thread). But no way works. Anyone can help me to enable it, or anyone can tell me whether its possible to do it? Thanks.

Community
  • 1
  • 1
Alex
  • 53
  • 5

1 Answers1

0

Try using the open method of IHTMLWindow2.

CComPtr<IHTMLWindow2> auth_win;
active_win->open(url,L"_blank",L"fullscreen=yes, toolbar=yes",false,&auth_win);
Naddy
  • 21
  • 7