zoukankan      html  css  js  c++  java
  • Delphi TWebBrowser强制使用指定版本的IE内核

    //强制Webbroser使用IE内核 SetWBCoreIE(8000);
    {
    SetWBCoreIE(11001);
    11001 (0x2af9) Internet Explorer 11
    10001 (0x2711) Internet Explorer 10。网页以IE 10的标准模式展现,页面!DOCTYPE无效
    10000 (0x02710) Internet Explorer 10。在IE 10标准模式中按照网页上!DOCTYPE指令来显示网页。Internet Explorer 10 默认值。
    9999 (0x270F) Windows Internet Explorer 9. 强制IE9显示,忽略!DOCTYPE指令
    9000 (0x2328) Internet Explorer 9. Internet Explorer 9默认值,在IE9标准模式中按照网页上!DOCTYPE指令来显示网页。
    8888 (0x22B8) Internet Explorer 8,强制IE8标准模式显示,忽略!DOCTYPE指令
    8000 (0x1F40) Internet Explorer 8默认设置,在IE8标准模式中按照网页上!DOCTYPE指令展示网页
    7000 (0x1B58) 使用WebBrowser Control控件的应用程序所使用的默认值,在IE7标准模式中按照网页上!DOCTYPE指令来展示网页。
    }
    procedure SetWBCoreIE(i_value:Integer);
    var
    str_exeName : string;
    reg : TRegistry;
    begin
    try
    str_exeName :=ExtractFileName(Application.ExeName); //RightFromStr(Application.ExeName,'',False);
    reg := TRegistry.Create(KEY_WOW64_64KEY or KEY_ALL_ACCESS);
    reg.RootKey := HKEY_LOCAL_MACHINE;
    if reg.OpenKey('SoftwareMicrosoftInternet ExplorerMainFeatureControl', False) then
    begin
    if not reg.KeyExists('FEATURE_BROWSER_EMULATION') then
    reg.CreateKey('FEATURE_BROWSER_EMULATION');
    end;
    reg.CloseKey;
    if reg.OpenKey('SoftwareMicrosoftInternet ExplorerMainFeatureControlFEATURE_BROWSER_EMULATION', False) then
    begin
    reg.WriteInteger(str_exeName,i_value);
    end;
    reg.CloseKey;
    reg.Free;
    except
    end;
    end;

  • 相关阅读:
    应该做什么样的研究:以Google为例
    机器学习问题方法总结
    浅析PageRank算法
    轮廓处理函数详细
    近视恢复方法
    一步一步深入视频接口
    什么是cookie
    Linux系统目录数和文件数限制
    九大视频接口全接触
    实时监控网卡流量的命令
  • 原文地址:https://www.cnblogs.com/mianli/p/12889053.html
Copyright © 2011-2022 走看看