1
0
mirror of https://github.com/salvadordf/CEF4Delphi.git synced 2025-10-30 23:07:52 +02:00

Added GetModulePath to uCEFMiscFunctions.pas

This commit is contained in:
Salvador Díaz Fau
2017-10-09 13:06:45 +02:00
parent 07ee3fd484
commit 4cddbb069b
6 changed files with 243 additions and 207 deletions

View File

@@ -112,6 +112,7 @@ function SystemTimeToTzSpecificLocalTime(lpTimeZoneInformation: PTimeZoneInforma
function PathIsRelativeAnsi(pszPath: LPCSTR): BOOL; stdcall; external SHLWAPIDLL name 'PathIsRelativeA';
function PathIsRelativeUnicode(pszPath: LPCWSTR): BOOL; stdcall; external SHLWAPIDLL name 'PathIsRelativeW';
function CustomPathIsRelative(const aPath : string) : boolean;
function GetModulePath : string;
function CefIsCertStatusError(Status : TCefCertStatus) : boolean;
function CefIsCertStatusMinorError(Status : TCefCertStatus) : boolean;
@@ -686,7 +687,7 @@ begin
if DirectoryExists(aSrcPath) then
begin
aRsltPath := IncludeTrailingPathDelimiter(aSrcPath);
if CustomPathIsRelative(aRsltPath) then aRsltPath := ExtractFilePath(ParamStr(0)) + aRsltPath;
if CustomPathIsRelative(aRsltPath) then aRsltPath := GetModulePath + aRsltPath;
end
else
Result := False;
@@ -823,6 +824,11 @@ begin
{$ENDIF}
end;
function GetModulePath : string;
begin
Result := IncludeTrailingPathDelimiter(ExtractFileDir(GetModuleName(HInstance)));
end;
function CefParseUrl(const url: ustring; var parts: TUrlParts): Boolean;
var
u: TCefString;