为WebBrowser指定IE内核版本(MSIE 7.0)
.Web Browser Control – Specifying the IE Version
http://www.west-wind.com/weblog/posts/2011/May/21/Web-Browser-Control-Specifying-the-IE-Version
I use the Internet Explorer Web Browser Control in a lot of my
applications to display document type layout. HTML happens to be one of
the most common document formats and displaying data in this format –
even in desktop applications, is often way easier than using normal
desktop technologies.
One issue the Web Browser Control has that it’s perpetually stuck in
IE 7 (MSIE 7.0) rendering mode by default. Even though IE 8 and now 9 have
significantly upgraded the IE rendering engine to be more CSS and HTML
compliant by default the Web Browser control will have none of it. IE 9
in particular – with its much improved CSS support and basic HTML 5
support is a big improvement and even though the IE control uses some of
IE’s internal rendering technology it’s still stuck in the old IE 7
(MSIE 7.0) rendering by default.
This applies whether you’re using the Web Browser control in a WPF
application, a WinForms app, a FoxPro or VB classic application using
the ActiveX control. Behind the scenes all these UI platforms use the
COM interfaces and so you’re stuck by those same rules.
Feature Delegation via Registry Hacks
Fortunately starting with Internet Explore 8 and later there’s a
fix for this problem via a registry setting. You can specify a registry
key to specify which rendering mode and version of IE should be used by
that application. These are not global mind you – they have to be
enabled for each application individually.
There are two different sets of keys for 32 bit and 64 bit applications.
[(HKEY_CURRENT_USER or HKEY_LOCAL_MACHINE)\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION]
32 bit:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION
Value Key: yourapplication.exe
64 bit:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION
Value Key: yourapplication.exe
The value to set this key to is (taken from MSDN here) as decimal values:
9999 (0x270F)
Internet Explorer 9. Webpages are displayed in IE9 Standards mode, regardless of the !DOCTYPE directive.
9000 (0x2328)
Internet Explorer 9. Webpages containing standards-based !DOCTYPE directives are displayed in IE9 mode.
8888 (0x22B8)
Webpages are displayed in IE8 Standards mode, regardless of the !DOCTYPE directive.
8000 (0x1F40)
Webpages containing standards-based !DOCTYPE directives are displayed in IE8 mode.
7000 (0x1B58)
Webpages containing standards-based !DOCTYPE directives are displayed in IE7 Standards mode.
为WebBrowser指定IE内核版本(MSIE 7.0)的更多相关文章
- Webbrowser指定IE内核版本(更改注册表)
如果电脑上安装了IE8或者之后版本的IE浏览器,Webbrowser控件会使用IE7兼容模式来显示网页内容.解决方法是在注册表中为你的进程指定引用IE的版本号. 比如我的程序叫做a.exe 对于32位 ...
- linux内核自己添加模块(内核版本:3.0.101)
做内核驱动第一步都是学习如何添加模块,这是基础,有了这个基础,剩下就是写代码了. 由于2.4到2.6内核版本的更新,无论是系统调用还是模块添加机制都有了巨大的变化,本人也因此饱经挫折,最后在3.0.1 ...
- 调整Winfrom控件WebBrowser的默认浏览器内核版本
一.问题解析: 今天在调试程序的时候,需要使用C#的客户端远程登录一个Web页面,用到了WebBrowser控件.但是却发现了一件很神奇的事情:当前浏览器使用的内核,可以通过访问下面这个网站获取:ht ...
- 调整WebBrowser的默认浏览器内核版本
原文出自:https://my.oschina.net/Tsybius2014/blog/492107 注:这个是写.net控件,其实delphi是一样的.作者已经写的比较全面了,我只是做了一点修改 ...
- Winfrom 中完美设置webbrowser控件内核版本
前言 .NET 版本更新了一代又一代,winform中的webbrowser控件的IE内核版本却始终用的IE7,好多网站都对IE7已经不支持.webbrowser这个控件就显得有些鸡肋,经过查找大佬门 ...
- c# webbrowser控件内核版本强制修改
int BrowserVer, RegVal; // get the installed IE version using (WebBrowser Wb = new WebBrowser()) Bro ...
- Buildroot 指定内核版本
/******************************************************************************** * Buildroot 指定内核版本 ...
- 通过批处理操作注册表实现winform应用中Webbrowser以指定的IE版本加载网页
通过批处理操作注册表实现winform应用中Webbrowser以指定的IE版本加载网页 rem 强制WebBrowser控件使用指定IE版本显示应用的网页 IF EXIST %windir%\Sys ...
- winfrom设置webBrowser框架默认的IE内核版本
要实现设置webBrowser框架默认的IE内核版本的功能需要三个方法 1:修改注册表信息来兼容当前程序 /// <summary> /// 修改注册表信息来兼容当前程序 /// /// ...
随机推荐
- 误: Apache shutdown unexpectedly解决办法
from:http://www.wopus.org/wordpress-basic/getting-started/2536.htmlXAMPP错 2015年10月20日15:58:19 新手上路发 ...
- 网页或WEB应用或PC端浏览器调用百度地图API
今天在写微网页中遇见了调用百度地图这个问题:在一个容器中显示地图信息如图(设计图截图) 然后在网上查了接口:http://api.map.baidu.com/,就是这个东东,当然不止这个,还有几个必选 ...
- 关于mysql联合索引
1 2 3 4 5 6 7 CREATE TABLE `uniontest` ( `id` int(11) NOT NULL AUTO_INCREMENT, `menuname` varcha ...
- Windows Azure 免费初体验 - 创建部署网站
前几天在看到有个学Windows Azure课程,送Windows Azure的活动,课程地址:http://www.microsoftvirtualacademy.com/ 在活得体验资格后,就迫不 ...
- 3993: [SDOI2015]星际战争
3993: [SDOI2015]星际战争 Time Limit: 10 Sec Memory Limit: 128 MBSec Special JudgeSubmit: 1244 Solved: ...
- 【BZOJ1977】[BeiJing2010组队]次小生成树 Tree 最小生成树+倍增
[BZOJ1977][BeiJing2010组队]次小生成树 Tree Description 小 C 最近学了很多最小生成树的算法,Prim 算法.Kurskal 算法.消圈算法等等. 正当小 C ...
- Starting Session of user root.
Sep 23 01:50:01 d systemd: Started Session 1475 of user root.Sep 23 01:50:01 d systemd: Starting Ses ...
- ThreadLocal (二):什么时候使用 InheritableThreadLocal
一.ThreadLocal 在父子线程传递的问题 public class InheritableThreadLocalDemo { // 全局变量 // static ThreadLocal< ...
- Numpy用于数组的文件输入输出
这一章比较简单,内容也比较少.而且对于文件的读写,还是使用pandas比较好.numpy主要是读写文本数据和二进制数据的. 将数组以二进制的格式保存到硬盘上 主要的函数有numpy.save和nump ...
- json教程系列(3)-JSONObject的过滤设置
我们通常对一个json串和java对象进行互转时,经常会有选择性的过滤掉一些属性值.例如下面的类: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ...