unit unit_CEF;
// C:\Programmieren\CEFDateien
// diese Unit dient dazu, den CEF wrapper einzubinden, dessen Datein in obigem Verzeichnis liegen
// das Programm ist aus Create des Forms aufzurufen, die den Browser einbinden will
// dabei lasse ich die dlls, die für shtml zuständig sind, im Hauptverzeichnis liegen.
// diese Dateien haben ca 100 MB und sind statisch. D.h. sie werden nicht täglich gesichert,
// sondern liegen in "Backup"
{$mode ObjFPC}{$H+}
interface
uses Classes, SysUtils;
Procedure Initialisiere_CEF;
const Pfad = 'C:\Programmieren\CEFDateien';
implementation
//Die CEFDateien Dateien müssen im selben Verzeichnis wie die "executables" liegen.
//Will ich das nicht, so steht unten, wie ich sie manuell einrichten kann.
//Hinweis: Die Dateien müssen zu Win 7 und dem Wrapper passen .
// ************************************************************************
// ***************************** CEF4Delphi *******************************
// ************************************************************************
//
// CEF4Delphi is based on DCEF3 which uses CEF3 to embed a chromium-based
// browser in Delphi applications.
//
// The original license of DCEF3 still applies to CEF4Delphi.
//
// For more information about CEF4Delphi visit :
// https://www.briskbard.com/index.php?lang=en&pageid=cef
//
// Copyright © 2018 Salvador Díaz Fau. All rights reserved.
//
// program SimpleBrowser2;
// CEF3 needs to set the LARGEADDRESSAWARE flag which allows 32-bit processes to use up to 3GB of RAM.
// If you don't add this flag the rederer process will crash when you try to load large images.
Procedure Initialisiere_CEF;
begin
//{$SetPEFlags IMAGE_FILE_LARGE_ADDRESS_AWARE}
//GlobalCEFApp := TCefApplication.Create;
// In case you want to use custom directories for the CEF3 binaries, cache and user data.
// If you don't set a cache directory the browser will use in-memory cache.
{
GlobalCEFApp.FrameworkDirPath := 'c:\cef';
GlobalCEFApp.ResourcesDirPath := 'c:\cef';
GlobalCEFApp.LocalesDirPath := 'c:\cef\locales';
GlobalCEFApp.EnableGPU := True; // Enable hardware acceleration
GlobalCEFApp.cache := 'c:\cef\cache';
GlobalCEFApp.UserDataPath := 'c:\cef\User Data';
}
//GlobalCEFApp.FrameworkDirPath := Pfad;
//GlobalCEFApp.ResourcesDirPath := Pfad;
//GlobalCEFApp.LocalesDirPath := Pfad + '\locales';
//GlobalCEFApp.EnableGPU := True; // Enable hardware acceleration
end;
//GlobalCEFApp.cache := 'c:\cef\cache';
//GlobalCEFApp.UserDataPath := 'c:\cef\User Data';
// You *MUST* call GlobalCEFApp.StartMainProcess in a if..then clause
// with the Application initialization inside the begin..end.
// Read this https://www.briskbard.com/index.php?lang=en&pageid=cef
{
if GlobalCEFApp.StartMainProcess then
begin
Application.Initialize;
{$IFDEF DELPHI11_UP}
Application.MainFormOnTaskbar := True;
{$ENDIF}
Application.CreateForm(TForm1, Form1);
Application.Run;
end;
GlobalCEFApp.Free;
GlobalCEFApp := nil;
end.
}
end.