• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

CEF4Delphi常用设置

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

CEF4Delphi 是由 SalvadorDíazFau 创建的一个开源项目,用于在基于Delphi的应用程序中嵌入基于Chromium的浏览器。

CEF4Delphi 基于Henri Gourvest 的 DCEF3。DCEF3的原始许可证仍适用于CEF4Delphi。阅读任何* .pas文件的第一行中的许可条款。

CEF4Delphi 使用CEF 3.3325.1756.g6d8faa4,其中包 Chromium 65.0.3325.181。CEF4Delphi使用的CEF3二进制文件可以在spotify下载:

32bit -> http://opensource.spotify.com/cefbuilds/cef_binary_3.3325.1756.g6d8faa4_windows32.tar.bz2

64bit -> http://opensource.spotify.com/cefbuilds/cef_binary_3.3325.1756.g6d8faa4_windows64.tar.bz2

CEF4Delphi是在Delphi 10.2 Tokyo上开发和测试的,已经在Delphi 7,Delphi XE和Delphi 10中测试过了。

有关CEF4Delphi的更多信息,请访问: https://www.briskbard.com/index.php?lang=en&pageid=cef

论坛:https://www.briskbard.com/forum

最新的组件支持 Windows 7, 8, 8.1, 10 或者更新版本.。如果需要在 Windows XP 和 Vista 中使用,请使用老版本: OldCEF4Delphi : https://github.com/salvadordf/OldCEF4Delphi

 下面的代码是一些常用的设置, 包括将DLL文件放到一个单独的目录下面,以及让 cef 使用内置的 flash:

function CefLibPath: string;
begin
{$IFDEF CPUX64}
  Result := 'CEF_3.3239.1709\Core64';
{$ELSE}
  Result := 'CEF_3.3239.1709\Core';
{$ENDIF}
end;

function PpapiFlashFileName: string;
begin
{$IFDEF CPUX64}
  Result := CefLibPath + '\plugins\pepflashplayer64.dll'
{$ELSE}
  Result := CefLibPath + '\plugins\pepflashplayer32.dll'
{$ENDIF}
end;

begin
  GlobalCEFApp := TCefApplication.Create;

  // In case you want to use custom directories for the CEF3 binaries, cache, cookies and user data.
  // If you don't set a cache directory the browser will use in-memory cache.
  GlobalCEFApp.FrameworkDirPath := CefLibPath;
  GlobalCEFApp.ResourcesDirPath := CefLibPath;
  GlobalCEFApp.LocalesDirPath   := CefLibPath + '\locales';
  GlobalCEFApp.Cache            := CefLibPath + '\cache';
  GlobalCEFApp.Cookies          := CefLibPath + '\cookies';
  GlobalCEFApp.UserDataPath     := CefLibPath + '\User Data';
  GlobalCEFApp.AcceptLanguageList:= 'zh-CN';
  GlobalCEFApp.LocalesRequired := 'zh-CN';
  GlobalCEFApp.Locale := 'zh-CN'; GlobalCEFApp.FlashEnabled :
= False; GlobalCEFApp.EnableGPU := True; // Enable hardware acceleration GlobalCEFApp.DisableGPUCache := True; // Disable the creation of a 'GPUCache' directory in the hard drive. GlobalCEFApp.AddCustomCommandLine('--ppapi-flash-path', PpapiFlashFileName); // You *MUST* call GlobalCEFApp.StartMainProcess in a if..then clause // with the Application initialization inside the begin..end. // Read this https://www.briskbard.com/index.php?lang=en&pageid=cef if GlobalCEFApp.StartMainProcess then begin Application.Initialize; {$IFDEF DELPHI11_UP} Application.MainFormOnTaskbar := True; {$ENDIF} Application.CreateForm(TForm1, Form1); Application.Run; end; GlobalCEFApp.Free; end.

 

 

 


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
DELPHI判断是否64位操作系统发布时间:2022-07-18
下一篇:
Matlab调用Java类发布时间:2022-07-18
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap