0

I am using IWebBrowser2 interface for rendering an IE page inside a window. I need to show the windows to the user once every thing is rendered. Now I am using DocumentComplete event, to call ShowWindow function. But the actual content shows after an initial grey screen followed by a white screen delay. I need to be able to show the window to the user avoiding these screens.

Any help is appreciated.

Nithin Mohan
  • 182
  • 4
  • 13

1 Answers1

0

You need to hook up the DWebBrowserEvents event sink. This sends a DocumentComplete notification that should be a good hint that the document is ready to be displayed.

To do this, first implement DWebBrowserEvents2 as an IDispatch based object. Then query the WebBrowser object for its IConectionPointContainter interface. Ask that via FindconnectionPoint for the IConnectionPoint interface for DIID_DWebBrowserEvents2, and then call Advise on that, passing your implementation of this dispatch interface.

Chris Becke
  • 750
  • 4
  • 10
  • I am using DocumentComplete event now(https://msdn.microsoft.com/en-us/library/aa768282(v=vs.85).aspx).( Sorry I missed that part when the question was posted. Edited now) – Nithin Mohan Oct 27 '15 at 14:03
  • Are you calling UpdateWindow immediately after ShowWindow - the WM_PAINT message is low priority so any other processing that is queued can cause a visible delay between the window showing and its first paint. UpdateWindow forces an immediate paint. – Chris Becke Oct 27 '15 at 14:47