BUG: WebBrowser in MFC Does Not Repaint After showModalDialogID: Q183161
|
The WebBrowser control hosted in an MFC application does not repaint
properly after the DHTML showModalDialog() function is called by the
displayed page and the dialog box is closed. Other dialog boxes such as
Alerts do not cause this problem.
After the dialog box is closed, a white patch, which is the size of
the dialog box, remains.
The WebBrowser control does not handle the WM_ERASEBKGND message correctly in this case.
Handle the WM_ERASEGKGND message in your CView-derived class. Return from the OnEraseBkgnd() method without calling the base class OnEraseBkgnd().
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.
To reproduce this behavior, follow these steps:
<SCRIPT LANGUAGE="VBScript">
Sub Btn_onClick
showModalDialog "test.htm"
End Sub
</SCRIPT>
<BUTTON ID="Btn">Open a New Window</BUTTON>
BOOL CWBView::OnEraseBkgnd(CDC* pDC)
{
return FALSE;
}
For more information about the WM_ERASEBKGND message and the OnEraseBkgnd
method, please refer to the Visual C++ 5.0 documentation.
For more information, please see the MSDN Web Workshop:
http://msdn.microsoft.com/workshop/default.asp
Additional query words: repaint erase WM_ERASEBKGND
Keywords : kbIE400 kbIE401 kbIE500 AXSDKWebBrowser
Version : WINDOWS:4.0,4.01
Platform : WINDOWS
Issue type : kbbug
Last Reviewed: April 30, 1999