Question

Hello and thank you taking the time to view my question.

I am making a C++ program which uses the Win32 API to create the initial program window. I then create a thread which creates a child window and I attach my Awesomium WebView to this child window.

I understand Awesomium is not thread safe but the documentation states that it is thread safe to the point that it allows you to use Awesomium in an alternate thread as long as you are using it in the thread it was created in.

Now for the issue. I have a problem receiving input from this thread back into the WinProc. If I attempt to click my mouse inside Awesomium which is parented to this child window then I can no longer drag the main window around the screen or use the minimize/maximize/close button nor does actually clicking on anything inside the awesomium window have any effect. I've done a lot of research and found AttachThreadInput() but that does not seem to help.

Does anyone know how I can send/receive messages to/from this thread into WinProc?

The current code is here: http://pastebin.com/i4kNHcch

Thank you very much your time is greatly appreciated.

Was it helpful?

Solution

Your problem could have nothing to do with the Awesomium being not thread safe. With a main window in one thread and a child window in another thread Windows can deadlock. The parent and child windows need to communicate with each other (inside the OS) and they are not designed to communicate out-of-thread.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top