Which renderer created in OnRenderProcessThreadCreated?

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.

Which renderer created in OnRenderProcessThreadCreated?

Postby emerick » Fri Dec 02, 2016 3:22 pm

In my Windows-based CEF3 application, I create a new browser in the WM_CREATE handler for my main application window and then load a URL. Since my application uses the WTL (similar to MFC), I want to subclass the browser window. In the past with CEF1, this involved subclassing the main browser window. However, with CEF3, subclassing the browser window isn't sufficient and I need to subclass the renderer window. Of course, the renderer process isn't created until after WM_CREATE is finished. I worked around this problem by subclassing the renderer window in OnRenderProcessThreadCreated instead of in WM_CREATE.

The issue I have is that my application creates a few other renderer processes (I guess because it loads a couple of URLs with different schemes/hosts). How can I tell "which" renderer process was created when OnRenderProcessThreadCreated is called? Is there a way to know which renderer was created or am I just going about this wrong?

Thanks,

Emerick
emerick
Expert
 
Posts: 154
Joined: Sun Feb 21, 2010 7:57 pm
Location: Belmont, MA

Re: Which renderer created in OnRenderProcessThreadCreated?

Postby magreenblatt » Mon Dec 05, 2016 5:46 am

For what purpose are you subclassing the browser window?
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Which renderer created in OnRenderProcessThreadCreated?

Postby emerick » Mon Dec 05, 2016 10:07 am

I believe our main goal in subclassing the browser window is to get a first crack at responding to certain types of messages, such as key and drag events. Our app is an editor that runs CEF in contentEditable mode. For example, until I subclassed the renderer window, I wasn't able to override Ctrl+A to select all text in the editor window.
emerick
Expert
 
Posts: 154
Joined: Sun Feb 21, 2010 7:57 pm
Location: Belmont, MA


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 41 guests