1
0
mirror of https://github.com/salvadordf/CEF4Delphi.git synced 2025-04-17 06:57:13 +02:00

46 lines
927 B
ObjectPascal
Raw Normal View History

2018-10-25 19:09:24 +02:00
program ConsoleLoader;
{$APPTYPE CONSOLE}
{$I ..\..\..\source\cef.inc}
2018-10-25 19:09:24 +02:00
{$R *.res}
uses
{$IFDEF DELPHI16_UP}
System.SysUtils;
2018-10-25 19:09:24 +02:00
{$ELSE}
SysUtils;
2018-10-25 19:09:24 +02:00
{$ENDIF }
procedure InitializeCEF4Delphi; stdcall; external 'OSRDLLBrowser.dll';
procedure FinalizeCEF4Delphi; stdcall; external 'OSRDLLBrowser.dll';
procedure ShowBrowser; stdcall; external 'OSRDLLBrowser.dll';
const
IMAGE_FILE_LARGE_ADDRESS_AWARE = $0020;
// CEF needs to set the LARGEADDRESSAWARE ($20) flag which allows 32-bit processes to use up to 3GB of RAM.
{$IFDEF WIN32}{$SetPEFlags IMAGE_FILE_LARGE_ADDRESS_AWARE}{$ENDIF}
2018-10-25 19:09:24 +02:00
procedure ExecuteProgram;
var
TempKey : char;
begin
Write('Press ENTER to show a web browser created in a Delphi DLL :');
Read(TempKey);
InitializeCEF4Delphi;
ShowBrowser;
FinalizeCEF4Delphi;
end;
begin
try
ExecuteProgram;
except
on E: Exception do
Writeln('Error : ', E.Message);
end;
end.