Solved

Updating WebBrowser control in a dialog

Posted on 1998-07-23
7
247 Views
Last Modified: 2013-11-20
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);
ASSERT(pWeb);
pWeb->Invalidate();
pWeb->UpdateWindow();
pWeb->Refresh();
} //OnPaint  
0
Comment
Question by:kahmed
7 Comments
 
LVL 23

Expert Comment

by:chensu
ID: 1319676
Did you call the base class OnPaint CDialog::OnPaint() in your dialog's OnPaint()?
0
 

Author Comment

by:kahmed
ID: 1319677
yes
0
 

Author Comment

by:kahmed
ID: 1319678
Adjusted points to 45
0
ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

 

Expert Comment

by:NotJeff
ID: 1319679
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
perfectly.

Jeff
0
 

Author Comment

by:kahmed
ID: 1319680
I have 4.x version that works fine. But I need to support customers with IE 3.x. Any ideas??
0
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 50 total points
ID: 1319681
Does the control have WS_CLIPSIBLINGS on it and does the dialog have the style WS_CLIPCHILDREN?
0
 

Author Comment

by:kahmed
ID: 1319682
No I use the default for the dialog and control
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
bigDiff challenge 17 106
sumHeights  challenge 17 70
noX challenge 17 116
Message not shown 5 50
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question