一.CEF加载网页时空白
chrm1.Load(‘你的网址’);
出现空白,跟踪进去:
frm := FBrowser.MainFrame; //此时为nil ,可改为:
frm := FBrowser.GetMainFrame;其他地方同上;
后续待更新。。
二、CEF程序退出时报错
{$R *.res} procedure RegisterSchemes(const registrar: ICefSchemeRegistrar); begin registrar.AddCustomScheme('local', True, True, False); end; begin // CefCache := getEnvironmentVariable('USERPROFILE')+'\GetTBData\cookies\'; CefCache := 'cache'; CefOnRegisterCustomSchemes := RegisterSchemes; CefSingleProcess := False; if not CefLoadLibDefault then Exit; // CefUserAgent := 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0;'; // CefUserAgent := 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_0) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11'; Application.Initialize; Application.CreateForm(TuMain, uMain); Application.Run; end.
三、Cef3加载flash网页方法:
修改ceflib.pas:
procedure TInternalApp.OnBeforeCommandLineProcessing(const processType: ustring;
const commandLine: ICefCommandLine); begin CommandLine.AppendSwitch('ppapi-out-of-process'); CommandLine.AppendSwitchWithValue('ppapi-flash-version', '22.0.0.168'); CommandLine.AppendSwitchWithValue('ppapi-flash-path', 'Plugins\\pepflashplayer.dll'); if Assigned(CefOnBeforeCommandLineProcessing) then CefOnBeforeCommandLineProcessing(processType, commandLine); end;网上下载 pepflashplayer.dll放入..\Plugins\\目录下面。四、cef3启动加载flash网页时Dos窗口闪一下的问题
网上的解决方法,参考此文。
http://blog.csdn.net/zx2356/article/details/51514403
按照该文及提供的下载挂钩createProcessA,在xp上无效。
2.解决方法
有可能createprocessw也得挂钩。但懒得修改了。因此决定改为反编译flash插件,看看显示命令行窗口的逻辑。
反编译flash插件。发现显示cmd的逻辑是,读取环境变量comspec(cmd.exe的全路径),读取到就执行它,读取不到执行cmd.exe.
用winhex修改flash插件,搜索comspec为soms1ec,修改cmd.exe为cm1.exe.
重新测试,成功。
修改后插件下载链接
http://download.csdn.net/detail/qsy2000/9768385
转载请注明出处,原文地址:
http://blog.csdn.net/xtfnpgy/article/details/71703317