1 Star 0 Fork 25

小马哥221/php_desktop

forked from lobtao/php_desktop 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
unV8Extension.pas 1.61 KB
一键复制 编辑 原始数据 按行查看 历史
lobtao 提交于 2018-08-30 20:31 . add feature
unit unV8Extension;
{$I cef.inc}
interface
uses
uCEFInterfaces, uCEFProcessMessage, uCEFv8Context, uCEFTypes, unConfig,
Generics.Collections, Windows,SysUtils;
type
TV8Extension = class
// ʾ
class procedure show(url: string; width: Integer; height: Integer);
// modalʾ
class procedure showmodal(url: string; width: Integer; height: Integer);
// ڷϢ
class procedure sendMsg(aMsg,aFrameName: string);
end;
implementation
{ TV8Extension }
class procedure TV8Extension.sendMsg(aMsg,aFrameName: string);
var
processIDList: TList<DWORD>;
i: Integer;
msg: ICefProcessMessage;
begin
msg := TCefProcessMessageRef.New(YS_BROWSER_EXTENSION_WINDOW_MSG);
msg.ArgumentList.SetString(0, aMsg);
msg.ArgumentList.SetString(1, aFrameName);
TCefv8ContextRef.Current.Browser.SendProcessMessage(PID_BROWSER, msg);
end;
class procedure TV8Extension.show(url: string; width: Integer; height: Integer);
var
msg: ICefProcessMessage;
begin
msg := TCefProcessMessageRef.New(YS_BROWSER_EXTENSION_SHOW);
msg.ArgumentList.SetString(0, url);
msg.ArgumentList.SetInt(1, width);
msg.ArgumentList.SetInt(2, height);
TCefv8ContextRef.Current.Browser.SendProcessMessage(PID_BROWSER, msg);
end;
class procedure TV8Extension.showmodal(url: string; width: Integer; height: Integer);
var
msg: ICefProcessMessage;
begin
msg := TCefProcessMessageRef.New(YS_BROWSER_EXTENSION_SHOWMODAL);
msg.ArgumentList.SetString(0, url);
msg.ArgumentList.SetInt(1, width);
msg.ArgumentList.SetInt(2, height);
TCefv8ContextRef.Current.Browser.SendProcessMessage(PID_BROWSER, msg);
end;
end.
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/juxianweixiaobao/php_desktop.git
git@gitee.com:juxianweixiaobao/php_desktop.git
juxianweixiaobao
php_desktop
php_desktop
master

搜索帮助