We have CEF windows embedded in windows in our application. If I click on a CEF window, the window with focus is a "Chrome Legacy Window" - Chrome_RenderWidgetHostHWND
If that window has focus and I try to make a COM call to CoCreateInstance, in my immediate case, to create the Microsoft Web Browser Control, or even to make a COM API call to it if I already created it, I get a COM error:
"An outgoing call cannot be made since the application is dispatching an input-synchronous call."
We create our host window in our main thread and create the CEF window as a child of that window and CEF creates the low level windows. I tried to move up the window tree to set focus on a parent window but, SetFocus returned zero indicating focus didn't change. GetLastError returns 87 - The parameter is incorrect. I went up the tree further and still got that error. Finally, I just tried setting focus to our app frame window and SetFocus returned an HWND and I verified is is my app window. But, still, when I make the COM call, I get the error.
I have to physically click outside the CEF window before I can make the COM call. I have no problem if any other window in our app has focus.
What is special about a CEF window having focus?
We have CEF 4103 build 97 if that matters.