Evento Chromium.SendProcessMessage(PID_RENDERER, TempMsg);
Posted: Mon Jan 23, 2023 12:37 pm
Good Morning!
Using the Demos, I created an Application that uses a Dll and a SubProcess to initialize the GlobalCEFApp ( TCefApplicationCore ) with the GlobalCEFApp.StartSubProcess. So far so good with initialization and termination and usage.
Now I need to visit the DOM to get the page's HTML. I took the methods and examples of the DOMvisitor Demo and included it in the project, I have a problem where when triggering the Chromium.SendProcessMessage(PID_RENDERER, TempMsg) event, the ChromiumProcessMessageReceived event is not receiving the messages, that is, it is not triggering.
I think it's because of the subprocess.
1 - If I set SingleProcess := True, it enters ChromiumProcessMessageReceived.
2 - If I remove BrowserSubprocessPath := 'SubProcess.exe', it also goes into ChromiumProcessMessageReceived.
The main project only initializes and finalizes the GlobalCEFApp ( TCefApplication ), calling the methods of the custom Dll.
The SubProcess initializes the GlobalCEFApp ( TCefApplicationCore ) always with the same binaries.
How do I need to treat the handles so that the messages are directed to the form that is created by the Dll ( webBrowser ) and not to the subprocess, in case that is the problem.
Using the Demos, I created an Application that uses a Dll and a SubProcess to initialize the GlobalCEFApp ( TCefApplicationCore ) with the GlobalCEFApp.StartSubProcess. So far so good with initialization and termination and usage.
Now I need to visit the DOM to get the page's HTML. I took the methods and examples of the DOMvisitor Demo and included it in the project, I have a problem where when triggering the Chromium.SendProcessMessage(PID_RENDERER, TempMsg) event, the ChromiumProcessMessageReceived event is not receiving the messages, that is, it is not triggering.
I think it's because of the subprocess.
1 - If I set SingleProcess := True, it enters ChromiumProcessMessageReceived.
2 - If I remove BrowserSubprocessPath := 'SubProcess.exe', it also goes into ChromiumProcessMessageReceived.
The main project only initializes and finalizes the GlobalCEFApp ( TCefApplication ), calling the methods of the custom Dll.
The SubProcess initializes the GlobalCEFApp ( TCefApplicationCore ) always with the same binaries.
How do I need to treat the handles so that the messages are directed to the form that is created by the Dll ( webBrowser ) and not to the subprocess, in case that is the problem.