Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
inet
active_desktop
active_scrptng
asp.components
asp.db
asp.general
comctl32
comp.packaging
components.dev
dbweb
dhtml_editing
docobjects
html_authoring
html_objmodel
iis
iis.ftp
iis.security
iis.smtp_nntp
indexserver
misc
mshtml_hosting
scripting.jscript
scripting.vbscript
sdk_setup
shell_objmodel
urlmonikers
webbrowser_ctl
wininet
  
 
date: Wed, 25 Jun 2008 06:43:05 -0700 (PDT),    group: microsoft.public.inetsdk.programming.webbrowser_ctl        back       


How to prevent WebBrowser from flickering when working with CAxHostWindow?   
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!!
date: Wed, 25 Jun 2008 06:43:05 -0700 (PDT)   author:   yuzhu.shen

Re: How to prevent WebBrowser from flickering when working with CAxHostWindow?   
"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.
date: Thu, 26 Jun 2008 00:32:43 +1000   author:   Leslie Milburn

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us