Hi, everyone. I read a thread in this group: "Flicker problems with WebBrowser control...", which suggests to remove (CS_VREDRAW | CS_HREDRAW) from the hosting window: >> "To remove the flicker from AtlBrowser, insert the following two lines before >> the Create(...) call in CAtlBrCon::Run() ... >> CWndClassInfo& wci = GetWndClassInfo(); >> wci.m_wc.style &= ~(CS_VREDRAW | CS_HREDRAW); " I added this code into the AtlBrowser sample project, and it worked perfectly. However, I couldn't make it work in my project: As Igor suggested in the thread "How to subclass a dialog-based ActiveX control". I used an aggregated CAxHostWindow to host the WebBrowser control (in order to add my own IOleCommandTarget to suppress script error dialogs). I found that CAxHostWindow 's GetWndClassInfo() does't have (CS_VREDRAW | CS_HREDRAW) set. Moreover, I removed these two styles from the window I passed into IAxWinHostWindow::CreateControl() and still had no luck. My WebBrowser control still has the flickering problem..... I feel bad when resizing my WebBrowser control, especially after I saw the "improved" AtlBrowser.... :( Any suggestion would be deeply appreciated!!
"yuzhu.shen" wrote in message news:5a66e31e-6858-4f92-9c0d-803bb931c784@v26g2000prm.googlegroups.com... > Hi, everyone. > > I read a thread in this group: "Flicker problems with WebBrowser > control...", which suggests to remove (CS_VREDRAW | CS_HREDRAW) from > the hosting window: > >>> "To remove the flicker from AtlBrowser, insert the following two lines >>> before >>> the Create(...) call in CAtlBrCon::Run() ... >>> CWndClassInfo& wci = GetWndClassInfo(); >>> wci.m_wc.style &= ~(CS_VREDRAW | CS_HREDRAW); " > > I added this code into the AtlBrowser sample project, and it worked > perfectly. > > However, I couldn't make it work in my project: > > As Igor suggested in the thread "How to subclass a dialog-based > ActiveX control". > I used an aggregated CAxHostWindow to host the WebBrowser control (in > order to add my own IOleCommandTarget to suppress script error > dialogs). > > I found that CAxHostWindow 's GetWndClassInfo() does't have > (CS_VREDRAW | CS_HREDRAW) set. Moreover, I removed these two styles > from the window I passed into IAxWinHostWindow::CreateControl() and > still had no luck. > My WebBrowser control still has the flickering problem..... I feel bad > when resizing my WebBrowser control, especially after I saw the > "improved" AtlBrowser.... :( > > Any suggestion would be deeply appreciated!! Hi, I used WS_CLIPCHILDREN on the parent window and then looked after all painting myself. Its been a while since I looked at this myself but from memory I came across painting issues anyway with plugins such as the Acrobat Reader plug in not repainting its toolbar correctly - so you need to do a bit of testing. Leslie.