Page 1 of 1

Re: multiple processes with exename

Posted: Wed Sep 04, 2019 2:34 pm
by salvadordf
Hi,

Yes, you can use a different EXE for the subprocesses.

Read all the code comments in the SubProcess demo for more details.

Re: multiple processes with exename

Posted: Wed Sep 04, 2019 3:35 pm
by salvadordf
The SubProcess project is extremely short in most cases. It only has 2 files : 1 DPR and 1 DPROJ

Without code comments, the minimum SubProcess.dpr file would be this :

Code: Select all

program SubProcess;

uses
  WinApi.Windows, uCEFApplication;

{$SetPEFlags IMAGE_FILE_LARGE_ADDRESS_AWARE}

begin
  GlobalCEFApp                  := TCefApplication.Create;
  GlobalCEFApp.DisableFeatures  := 'NetworkService,OutOfBlinkCors';
  GlobalCEFApp.StartSubProcess;
  DestroyGlobalCEFApp;
end.
You would only need to set the GlobalCEFApp properties and the "GlobalCEFApp.DisableFeatures" line will probably disappear in the next Chromium update.

This is the preferred solution for projects that need to add a CEF browser and they want to do very few modifications to the main DPR file, or they have a complex initialization in the main project and adding CEF makes it even harder to maintain.