redraw issue inside MFC modal dialog

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

redraw issue inside MFC modal dialog

Postby wundram » Thu Apr 12, 2012 11:17 am

I have a CEF browser inside a MFC Modal dialog window. It works fine, except that it is not repainting the window when it is dragged off screen, and back onto the screen. This only seems to happen when running inside a modal dialog. I checked with spy++, and the WM_PAINT messages are getting all the way to the WebViewHost host window, so it isn't a matter of the WM_PAINT messages being blocked. Any ideas on how to fix this?
wundram
Newbie
 
Posts: 8
Joined: Thu Feb 23, 2012 12:33 pm

Re: redraw issue inside MFC modal dialog

Postby magreenblatt » Thu Apr 12, 2012 5:27 pm

Modal dialogs run their own message loop. If you're not using multi-threaded message loop mode you need to make sure that CefDoMessageLoopWork() is getting called while the dialog is visible.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: redraw issue inside MFC modal dialog

Postby wundram » Fri Apr 13, 2012 11:13 am

I am using the multithreaded message loop. The problem turned out to be that I needed to override WM_ERASEBKGND on the outermost frame as well as on the view containing the browser.
wundram
Newbie
 
Posts: 8
Joined: Thu Feb 23, 2012 12:33 pm

Re: redraw issue inside MFC modal dialog

Postby John » Mon Apr 30, 2012 11:50 pm

wundram,
I am having the similar issue now. Could you share some details on what you have done on resolving this issue? Thanks in advance for the help.

John
John
Techie
 
Posts: 12
Joined: Tue Apr 24, 2012 12:25 pm


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 242 guests