procedure TregedtIE.FormCreate(Sender: TObject);  
begin  
  WriteAppNameToReg;  
  WebBrowser1.Navigate('C:\a.html');  
end;  
{--}  
{需要注意是GetNativeSystemInfo 函数从Windows XP 开始才有, 
 而 IsWow64Process 函数从 Windows XP with SP2 以及 Windows Server 2003 with SP1 开始才有。 
 所以使用该函数的时候最好用GetProcAddress 。 
}  
function TregedtIE.IsWin64: Boolean;  
var  
  Kernel32Handle: THandle;  
  IsWow64Process: function(Handle: Windows.THandle; var Res: Windows.BOOL): Windows.BOOL; stdcall;  
  GetNativeSystemInfo: procedure(var lpSystemInfo: TSystemInfo); stdcall;  
  isWoW64: Bool;  
  SystemInfo: TSystemInfo;  
const  
  PROCESSOR_ARCHITECTURE_AMD64 = ;  
  PROCESSOR_ARCHITECTURE_IA64 = ;  
begin  
  Kernel32Handle := GetModuleHandle('KERNEL32.DLL');  
  if Kernel32Handle =  then  
    Kernel32Handle := LoadLibrary('KERNEL32.DLL');  
  if Kernel32Handle <>  then  
  begin  
    IsWOW64Process := GetProcAddress(Kernel32Handle,'IsWow64Process');  
    GetNativeSystemInfo := GetProcAddress(Kernel32Handle,'GetNativeSystemInfo');  
    if Assigned(IsWow64Process) then  
    begin  
      IsWow64Process(GetCurrentProcess,isWoW64);  
      Result := isWoW64 and Assigned(GetNativeSystemInfo);  
      if Result then  
      begin  
        GetNativeSystemInfo(SystemInfo);  
        Result := (SystemInfo.wProcessorArchitecture = PROCESSOR_ARCHITECTURE_AMD64) or  
                  (SystemInfo.wProcessorArchitecture = PROCESSOR_ARCHITECTURE_IA64);  
      end;  
    end  
    else Result := False;  
  end  
  else Result := False;  
end;  
{--}  
function TregedtIE.WriteAppNameToReg: Boolean;  
var  
  reg :TRegistry;  
  sPath,sAppName:String;  
begin  
  Result := True;  
  reg := TRegistry.Create;  
  try  
    reg.RootKey := HKEY_LOCAL_MACHINE;  
    sPath := 'SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION';  
    if isWin64 then  
      sPath := 'SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION';  
    if reg.OpenKey(sPath,True) then  
    begin  
      sAppName := ExtractFileName(Application.ExeName);  
     if not reg.ValueExists(sAppName) then  
        reg.WriteInteger(sAppName,);  
    end;  
    reg.CloseKey;  
  finally  
    FreeAndNil(reg);  
  end;  
end;  
{--}  
procedure TregedtIE.WebBrowser1DocumentComplete(ASender: TObject;  
  const pDisp: IDispatch; var URL: OleVariant);  
begin  
  WebBrowser1.OleObject.Document.Body.Scroll := 'no';  
  WebBrowser1.OleObject.Document.Body.style.border := 'none';  
  webbrowser1.OleObject.Document.Body.Style.margin := '0px';  
end;  

http://blog.csdn.net/wensibo/article/details/25971863

【转】解决Delphi WebBrowser 无法调用当前浏览器的版本的更多相关文章

  1. Delphi WebBrowser 无法调用当前浏览器的版本 --转

    出自:http://blog.csdn.net/wensibo/article/details/25971863 procedure TregedtIE.FormCreate(Sender: TObj ...

  2. javascript 函数节流 throttle 解决函数被频繁调用、浏览器卡顿的问题

    * 使用setTimeout index.html <html> <head> <meta charset="UTF-8"> <title ...

  3. delphi WebBrowser的使用方法详解(五)-难点释疑

    网页代码:<SELECT id=fy onchange=TouchRefresh(1) name=fy> <OPTION selected value=15>每頁顯示15筆&l ...

  4. <总结>delphi WebBrowser控件的使用中出现的bug

    Delphi WebBrowser控件的使用中出现的bug:  1.WebBrowser.Visible=false:Visible属性不能使WebBrowser控件不可见,暂时用 WebBrowse ...

  5. Delphi WebBrowser控件的使用(大全 good)

    Delphi WebBrowser控件的使用 WebBrowser控件属性:1.Application      如果该对象有效,则返回掌管WebBrowser控件的应用程序实现的自动化对象(IDis ...

  6. delphi webbrowser用法集锦

    delphi webbrowser用法集锦 (2012-05-13 08:29:00) 标签: it 分类: 软件_Software WebBrowser1.GoHome; //到浏览器默认主页 We ...

  7. 完美解决C#Webbrowser控件设置Cookie问题

    完美解决C#Webbrowser控件设置Cookie问题由于个人项目需求,需要把从抓包里面的Cookie数据写入到webbrowser空控件里,经过百度白百般折腾,结果还是失败,搜索到的答案基本上都是 ...

  8. Delphi Dll 动态调用例子(3)-仔细看一下

    http://blog.163.com/bxf_0011/blog/static/35420330200952075114318/ Delphi 动态链接库的动态和静态调用 为了让人能快速的理解 静态 ...

  9. 在Delphi中静态调用DLL

    在Delphi中静态调用DLL top 调用一个DLL比写一个DLL要容易一些.首先给大家介绍的是静态调用方法,稍后将介绍动态调用方法,并就两种方法做一个比较.同样的,我们先举一个静态调用的例子. u ...

随机推荐

  1. ThinkCmfX模板常量

    一.public文件: 1.各种js文件,包括cookie.js.ajaxFrom.js等系统自带的js文件 2.simpleboot:bootstrap.图标font文件 二.themes:前端模板 ...

  2. nginx tomcat 动静分离

    所谓动静分离就是通过nginx(或apache等)来处理用户端请求的图片.html等静态的文件,tomcat(或weblogic)处理jsp.do等动态文件</span>,从而达到动静页面 ...

  3. CG_INLINE,inline 内联函数

    内联函数,即在编译的时候将函数体替换函数调用,从而不需要将parameter,return address进行push/pop stack的操作,从而加速app的运行,然而,会增加二进制文件的大小. ...

  4. 测试post接口curl

    function post($url,$data=array()) { if ( !empty($data) ) { $data=http_build_query($data); } $ch = cu ...

  5. 网络编程学习笔记:linux下的socket编程

    socket是进程通信的一种方式,通过调用一些API可以实现进程间通信,建立连接以及收发信息的过程如下图所示: 这些函数的用法如下: 1.int socket(int protocolFamily, ...

  6. TCP协议学习笔记(一)首部以及TCP的三次握手连接四次挥手断开

    TCP协议是一种面向连接的.可靠的流协议. 流即不间断的数据结构.这样能够保证接收到数据顺序与发送相同.但是犹如数据间没有间隔,因此在TCP通信中,发送端应用可以在自己所要发送的消息中设置一个标示长度 ...

  7. C# EF增删改查

    1.增 //1.创建一个EF数据上下文对象 MyDBEntities context=new MyDBEntities(); //2.将要添加的数据,封装成对象 Users user = new Us ...

  8. Oracle 索引创建、表分区

    --EAF_WORKFLOWSTEP 表创建 CREATE TABLE EAF_WORKFLOWSTEP ( ) NOT NULL PRIMARY KEY USING INDEX TABLESPACE ...

  9. CDN技术详解

    CDN,全称为Content DeliveryNetwork,中文意为"内容分发网络"".通过将网络内容发布到最靠近用户的『边缘节点』,使不同地区的用户在访问相同页面.图 ...

  10. java基础类型、包装器

    char a = 'h';  //类包装器 Character aobj = a ;//自动装箱 byte b = 6; Byte bobj = b; short s = 234; Short sob ...