0

I'm having trouble opening a new CAxWindow inside my BHO, I can see the request to "microsoft.com" being fired but no window is shown. I tried many different ways, this is my last, anyone has a clue what's wrong?

thanks.

CAxWindow m_axWindow;
CRect rc;
HWND wndIE = NULL;
m_pWebBrowser->get_HWND((SHANDLE_PTR*)&wndIE);
GetWindowRect(wndIE, &rc);
CSize sz = CSize(100, 200);
CRect rcPage = new CRect(10, 10, 10, 10);
m_axWindow.Create(wndIE, rcPage, _TEXT("http://www.microsoft.com"), WS_POPUP | WS_TABSTOP, 0, 0U, 0);
HRESULT hRet = m_axWindow.QueryControl(IID_IWebBrowser2, (void**)&m_pWebBrowser);
user1326293
  • 923
  • 2
  • 9
  • 24
  • I noticed you posted [another BHO question](http://stackoverflow.com/q/19106095/2674222), so have you solved this one? If yes, what was the problem and how did you solve? – avo Oct 01 '13 at 05:48

1 Answers1

0

I think m_axWindow.Create creates a child window. Check its style for WS_CHILD after that call. You probably need to create a plain popup top-level window first, then create a CAxWindow using that popup window as parent, not the wndIE. Make sure to do ShowWindow on the pop-up, too.

avo
  • 10,101
  • 13
  • 53
  • 81