Page 2 of 3

Re: How to create and destroy browser form?

Posted: Fri Jul 03, 2020 11:14 am
by salvadordf
It's been a long time since the last time I took a look at the source code of the DCEF3 project.

It should be possible but you will have to "translate" what you see in the ToolboxBrowser demo.
As you can see, the CEF initialization and finalization steps are different.

Re: How to create and destroy browser form?

Posted: Fri Jul 03, 2020 11:26 am
by andreykrasnodar
Thanks for the link

Re: How to create and destroy browser form?

Posted: Fri Jul 03, 2020 12:18 pm
by andreykrasnodar
I have installed old cef 4 version, but my project could not compiled.

Code: Select all

Chromium1.Browser.Host.SendMouseClickEvent(@MouseCoord, MBT_LEFT, false, 1);
[dcc32 Error] Unit1.pas(348): E2010 Incompatible types: 'uCEFTypes.TCefMouseButtonType' and 'ceflib.TCefMouseButtonType'

Re: How to create and destroy browser form?

Posted: Fri Jul 03, 2020 12:24 pm
by salvadordf
The DCEF3, CEF4Delphi and OldCEF4Delphi projects share many class names, data type names, event names, etc.

If you work with one of them then you will have to uninstall the rest and remove the other projects from the library path.

The error you have is caused by this and you will have to uninstall DCEF3 before you install OldCEF4Delphi.

Re: How to create and destroy browser form?

Posted: Fri Jul 03, 2020 1:00 pm
by andreykrasnodar
ok, i did it. I have uninstalled both and installed CEF4 OLD.
But there are new problems. It is really hard to remake project written on cef3 to cef4. No ceflib here and problems begins with string

Code: Select all

var   CookieManager: iCefCookieManager; 
because no iCefCookieManager in this version.

Maybe anybody knows how to create and destroy form containing Chromium in cef3.

Re: How to create and destroy browser form?

Posted: Fri Jul 03, 2020 1:24 pm
by andreykrasnodar
Anybody please help me

Re: How to create and destroy browser form?

Posted: Fri Jul 03, 2020 1:46 pm
by salvadordf
The CookieVisitor demo in OldCEF4Delphi has all the code to get and set the cookies.

Re: How to create and destroy browser form?

Posted: Fri Jul 03, 2020 6:16 pm
by andreykrasnodar
CEF3 also creates global application which I can not terminate after closing form.
Everything is ok and no need to rewrite project using CEF 4, but I only need analog of GlobalCEFApp.Free for CEF3.

Re: How to create and destroy browser form?

Posted: Fri Jul 03, 2020 7:11 pm
by andreykrasnodar
I have found function CEFShutDown. Hope it will help.

Code: Select all

  // This function should be called on the main application thread to shut down
  // the CEF browser process before the application exits.
  cef_shutdown: procedure(); {$IFDEF CPUX64}stdcall{$ELSE}cdecl{$ENDIF};

Re: How to create and destroy browser form?

Posted: Fri Jul 03, 2020 7:46 pm
by andreykrasnodar
I am trying to do this

Code: Select all

procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  CefShutdown();
end;
but nothing happened: the process is still in the task manager after closing main form