I'm using Chromium Embedded Framework(CEF) to develop a windows desktop application(using C++/Win32, No MFC). I have used the sample "cefsimple" project and extended on it till now. I have added "Handlers" for keyboard events etc. Everything works fine till now, I can get the handle of the browser window and play with it.
Now I couldn't find a way to handle the event messages received from outside. Example: A third party application sends some data to my application and I need to receive it. Or I need to handle mouse events.
CefRefPtr<SimpleApp> app(new SimpleApp);
int exit_code = CefExecuteProcess(main_args, app.get(), sandbox_info);
if (exit_code >= 0) {
return exit_code;
}
// Specify CEF global settings here.
CefSettings settings;
#if !defined(CEF_USE_SANDBOX)
settings.no_sandbox = true;
#endif
settings.single_process = true;
settings.windowless_rendering_enabled = true;
// Initialize CEF.
CefInitialize(main_args, settings, app.get(), sandbox_info);
// Run the CEF message loop. This will block until CefQuitMessageLoop() is
// called.
CefRunMessageLoop();
// Shut down CEF.
CefShutdown();
This is my current main function. Am I missing something here? CefRunMessageLoop() runs the custom CEF messaging loop and I have no way of receiving those messages.
I have been trying to get a solution for this for past 2 days :(
see CefDoMessageLoopWork(), this is meant to be called from your own message loop. So you could implement your windows message loop and call this on idle.
This is from the comment to cef_do_message_loop_work() which is what CefDoMessageLoopWork() calls and gives more information:
So you will have to implement your own Windows event loop, but you would have to to handle your own mouse events etc. anyway.