1
0
mirror of https://github.com/salvadordf/CEF4Delphi.git synced 2025-11-23 21:34:53 +02:00

FPC compatibility with all missing MSWINDOWS features (Drag&Drop, OnBrowserCompMsg/OnWidgetCompMsg/OnRenderCompMsg) that VCL/FMX already had

Some Linux support (compiles and can load the libcef.so but still crashes when calling CreateBrowser)
This commit is contained in:
Andreas Hausladen
2019-11-10 18:23:39 +01:00
parent d897a1d815
commit eb0d04f1b5
25 changed files with 525 additions and 345 deletions

View File

@@ -133,19 +133,21 @@ begin
end;
function TCEFWinControl.TakeSnapshot(var aBitmap : TBitmap) : boolean;
{$IFDEF MSWINDOWS}
var
TempHWND : HWND;
TempDC : HDC;
TempRect : TRect;
TempWidth : Integer;
TempHeight : Integer;
{$ENDIF}
begin
Result := False;
{$IFDEF MSWINDOWS}
if (aBitmap = nil) then exit;
TempHWND := ChildWindowHandle;
if (TempHWND = 0) then exit;
{$IFDEF MSWINDOWS}
{$IFDEF DELPHI16_UP}Winapi.{$ENDIF}Windows.GetClientRect(TempHWND, TempRect);
TempDC := GetDC(TempHWND);
TempWidth := TempRect.Right - TempRect.Left;
@@ -163,12 +165,16 @@ begin
end;
function TCEFWinControl.DestroyChildWindow : boolean;
{$IFDEF MSWINDOWS}
var
TempHWND : HWND;
{$ENDIF}
begin
{$IFDEF MSWINDOWS}
TempHWND := ChildWindowHandle;
Result := (TempHWND <> 0) and DestroyWindow(TempHWND);
{$ELSE}
Result := False;
{$ENDIF}
end;