You are using the same executable for all the CEF processes : main browser process, render processes, etc.
In this configuration your application will run your EXE multiple times and that means that the code inside the DPR will be run for the main browser process and also for each subprocess.
The most simple code inside a DPR would be like this :
(I added some line numbers to make it clear)
Code: Select all
(1) GlobalCEFApp := TCefApplication.Create;
(2) if GlobalCEFApp.StartMainProcess then
begin
(3) Application.Initialize;
(4) Application.CreateForm(TForm1, Form1);
(5) Application.Run;
end;
(6) GlobalCEFApp.Free;
When a user runs your application the PC will execute 1, 2, 3 ,4 and 5. Then the app stays inside line 5 until the user closes the app and then line 6 is executed.
While the app is running it may create several subprocesses that will execute 1 and 2. In this case CEF detects that this is a subprocess and it will stay inside line 2 until the process is closed. When that subprocess is closed then GlobalCEFApp.StartMainProcess returns FALSE and line 6 is executed.
CEF uses many command line parameters to launch each subprocess that might be incorrectly interpreted. Use unique name-value pairs to identify your parameters and move the code to interpret them between the "begin" and line 3.
If you want to show error messages, check that GlobalCEFApp.ProcessType is ptBrowser and then check GlobalCEFApp.Status to show customized messages in case it has one of these values : asErrorMissingFiles, asErrorDLLVersion, asErrorLoadingLibrary, asErrorInitializingLibrary, asErrorExecutingProcess. If some binaries are missing then GlobalCEFApp.MissingLibFiles will have their names.