mirror of
https://github.com/salvadordf/CEF4Delphi.git
synced 2025-04-17 06:57:13 +02:00
Added TCefApplication.SetCurrentDir property to set the current directory before loading the CEF libraries
This commit is contained in:
parent
6dbaa022da
commit
07ee3fd484
@ -122,6 +122,7 @@ type
|
|||||||
FReRaiseExceptions : boolean;
|
FReRaiseExceptions : boolean;
|
||||||
FUpdateChromeVer : boolean;
|
FUpdateChromeVer : boolean;
|
||||||
FShowMessageDlg : boolean;
|
FShowMessageDlg : boolean;
|
||||||
|
FSetCurrentDir : boolean;
|
||||||
FChromeVersionInfo : TFileVersionInfo;
|
FChromeVersionInfo : TFileVersionInfo;
|
||||||
FLibHandle : THandle;
|
FLibHandle : THandle;
|
||||||
FOnRegisterCustomSchemes : TOnRegisterCustomSchemes;
|
FOnRegisterCustomSchemes : TOnRegisterCustomSchemes;
|
||||||
@ -139,7 +140,7 @@ type
|
|||||||
function GetLibCefPath : string;
|
function GetLibCefPath : string;
|
||||||
function GetChromeElfPath : string;
|
function GetChromeElfPath : string;
|
||||||
|
|
||||||
function LoadCEFlibrary : boolean;
|
function LoadCEFlibrary : boolean; virtual;
|
||||||
function Load_cef_app_capi_h : boolean;
|
function Load_cef_app_capi_h : boolean;
|
||||||
function Load_cef_browser_capi_h : boolean;
|
function Load_cef_browser_capi_h : boolean;
|
||||||
function Load_cef_command_line_capi_h : boolean;
|
function Load_cef_command_line_capi_h : boolean;
|
||||||
@ -246,6 +247,7 @@ type
|
|||||||
property EnableGPU : boolean read FEnableGPU write FEnableGPU;
|
property EnableGPU : boolean read FEnableGPU write FEnableGPU;
|
||||||
property CheckCEFFiles : boolean read FCheckCEFFiles write FCheckCEFFiles;
|
property CheckCEFFiles : boolean read FCheckCEFFiles write FCheckCEFFiles;
|
||||||
property ShowMessageDlg : boolean read FShowMessageDlg write FShowMessageDlg;
|
property ShowMessageDlg : boolean read FShowMessageDlg write FShowMessageDlg;
|
||||||
|
property SetCurrentDir : boolean read FSetCurrentDir write FSetCurrentDir;
|
||||||
property ChromeMajorVer : uint16 read FChromeVersionInfo.MajorVer;
|
property ChromeMajorVer : uint16 read FChromeVersionInfo.MajorVer;
|
||||||
property ChromeMinorVer : uint16 read FChromeVersionInfo.MinorVer;
|
property ChromeMinorVer : uint16 read FChromeVersionInfo.MinorVer;
|
||||||
property ChromeRelease : uint16 read FChromeVersionInfo.Release;
|
property ChromeRelease : uint16 read FChromeVersionInfo.Release;
|
||||||
@ -365,6 +367,7 @@ begin
|
|||||||
FReRaiseExceptions := False;
|
FReRaiseExceptions := False;
|
||||||
FLibLoaded := False;
|
FLibLoaded := False;
|
||||||
FShowMessageDlg := True;
|
FShowMessageDlg := True;
|
||||||
|
FSetCurrentDir := False;
|
||||||
FUpdateChromeVer := aUpdateChromeVer;
|
FUpdateChromeVer := aUpdateChromeVer;
|
||||||
|
|
||||||
UpdateDeviceScaleFactor;
|
UpdateDeviceScaleFactor;
|
||||||
@ -856,6 +859,8 @@ end;
|
|||||||
|
|
||||||
function TCefApplication.LoadCEFlibrary : boolean;
|
function TCefApplication.LoadCEFlibrary : boolean;
|
||||||
begin
|
begin
|
||||||
|
if FSetCurrentDir then chdir(ExtractFileDir(ParamStr(0)));
|
||||||
|
|
||||||
FLibHandle := LoadLibraryEx(PChar(LibCefPath), 0, LOAD_WITH_ALTERED_SEARCH_PATH);
|
FLibHandle := LoadLibraryEx(PChar(LibCefPath), 0, LOAD_WITH_ALTERED_SEARCH_PATH);
|
||||||
|
|
||||||
if (FLibHandle = 0) then
|
if (FLibHandle = 0) then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user