Updating WebBrowser control in a dialog

I have a dialog application with IE webbrowser control 3.02.
I can navigate, refresh,...etc.
The problem is whenever My dialog is minimized or covered by other windows, the browser control is not re-painted when my dialog gets the focus or maximized. I get grey color in the control space.

That means my dialog's OnPaint() is updating all controls execpt webbrowser. Does any one know why and how to force my webbrowser control to be updated when the dialig gets the focus?

Here is the code I added to the end of OnPaint() and did not work (I have the problem with ond without adding that code):

CWebBrowser* pWeb = (CWebBrowser*)GetDlgItem(IDC_EXPLORER1);
} //OnPaint  
Who is Participating?
Tommy HuiConnect With a Mentor EngineerCommented:
Does the control have WS_CLIPSIBLINGS on it and does the dialog have the style WS_CLIPCHILDREN?
Did you call the base class OnPaint CDialog::OnPaint() in your dialog's OnPaint()?
kahmedAuthor Commented:
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

kahmedAuthor Commented:
Adjusted points to 45
Is it possible for you to update to IE 4.0+?   I was having the same problems you were along with some others.  I tried fixing them like you, but it just wouldn't work.  I
installed IE 4.0 and readded the control to my project and everything worked

kahmedAuthor Commented:
I have 4.x version that works fine. But I need to support customers with IE 3.x. Any ideas??
kahmedAuthor Commented:
No I use the default for the dialog and control
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.