注册 登录  
 加关注
查看详情
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

从C开始

 
 
 

日志

 
 

获取IE版本号  

2010-10-24 14:23:40|  分类: SDK编程 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

程序中使用IEWebBrowser 控件(MSHTML)或者开发BHO插件的时候,通常需要获得IE的版本号以便做不同处理。这里介绍2中获得IE版本号的方法:

1) 通过注册表

IE的版本号信息放在注册表的:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Version 

注:64位机器的32IE HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\Version 

 

2) 通过读取mshtml.dll 的版本号

mshtmlIE的核心DLL之一。 mshtml.dll文件的版本号码和IE的版本号码应该是一致的。以下代码演示如何获得mshtml.dll的版本号。

 

#include "stdafx.h"

#include <Windows.h>

#include <stdio.h>

#include <TCHAR.h>

 

int main(void)

{

       TCHAR szFilename[] = _T("mshtml.dll"); 

       DWORD dwMajorVersion =0, dwMinorVersion = 0; 

       DWORD dwBuildNumber =0, dwRevisionNumber = 0; 

       DWORD dwHandle = 0; 

       DWORD dwVerInfoSize = GetFileVersionInfoSize(szFilename, &dwHandle); 

       if (dwVerInfoSize) 

       { 

              LPVOID lpBuffer = LocalAlloc(LPTR, dwVerInfoSize); 

              if (lpBuffer) 

              { 

                     if (GetFileVersionInfo(szFilename, dwHandle, dwVerInfoSize, lpBuffer)) 

                     { 

                            VS_FIXEDFILEINFO * lpFixedFileInfo = NULL; 

                            UINT nFixedFileInfoSize = 0; 

                            if (VerQueryValue(lpBuffer, TEXT("\\"), (LPVOID*)&lpFixedFileInfo, &nFixedFileInfoSize) &&(nFixedFileInfoSize)) 

                            { 

                                   dwMajorVersion = HIWORD(lpFixedFileInfo->dwFileVersionMS);   

                                   dwMinorVersion = LOWORD(lpFixedFileInfo->dwFileVersionMS);   

                                   dwBuildNumber = HIWORD(lpFixedFileInfo->dwFileVersionLS);   

                                   dwRevisionNumber = LOWORD(lpFixedFileInfo->dwFileVersionLS); 

                            } 

                     } 

                     LocalFree(lpBuffer); 

              } 

       } 

       printf("mshtml.dll VersionInfo: \n\tMajorVersion=%d\n\tMinorVersion=%d\n\tBuildNumber=%d\n\tRevisionNumber=%d\n", 

              dwMajorVersion, dwMinorVersion, dwBuildNumber, dwRevisionNumber); 

 

       return 0;

}

通过以上2种方法获得 MajorVersion, MinorVersion, BuildNumber, RevisionNumber.


IE版本号

Version           Product

   -----------------------------------------------------------------

   4.40.308         Internet Explorer 1.0 (Plus! for Windows 95)

   4.40.520         Internet Explorer 2.0

   4.70.1155         Internet Explorer 3.0

   4.70.1158         Internet Explorer 3.0 (Windows 95 OSR2)

   4.70.1215         Internet Explorer 3.01

   4.70.1300         Internet Explorer 3.02 and 3.02a

   4.71.544         Internet Explorer 4.0 Platform Preview 1.0 (PP1)

   4.71.1008.3       Internet Explorer 4.0 Platform Preview 2.0 (PP2)

   4.71.1712.6       Internet Explorer 4.0

   4.72.2106.8       Internet Explorer 4.01

   4.72.3110.8       Internet Explorer 4.01 Service Pack 1 (Windows 98)

   4.72.3612.1713   Internet Explorer 4.01 Service Pack 2 

   5.00.0518.10     Internet Explorer 5 Developer Preview (Beta 1)

   5.00.0910.1309   Internet Explorer 5 Beta (Beta 2)

   5.00.2014.0216   Internet Explorer 5

   5.00.2314.1003   Internet Explorer 5 (Office 2000)

   5.00.2614.3500   Internet Explorer 5 (Windows 98 Second Edition)

   5.00.2516.1900   Internet Explorer 5.01 (Windows 2000 Beta 3, build 5.00.2031)

   5.00.2919.800     Internet Explorer 5.01 (Windows 2000 RC1, build 5.00.2072)

   5.00.2919.3800   Internet Explorer 5.01 (Windows 2000 RC2, build 5.00.2128)

   5.00.2919.6307   Internet Explorer 5.01 (Office 2000 SR-1)

   5.00.2920.0000   Internet Explorer 5.01 (Windows 2000, build 5.00.2195)

   5.00.3103.1000   Internet Explorer 5.01 SP1 (Windows 2000 SP1)

   5.00.3105.0106   Internet Explorer 5.01 SP1 (Windows 95/98 and Windows NT 4.0)

   5.00.3314.2101   Internet Explorer 5.01 SP2 (Windows 95/98 and Windows NT 4.0)

   5.00.3315.1000   Internet Explorer 5.01 SP2 (Windows 2000 SP2)

   5.00.3502.1000   Internet Explorer 5.01 SP3 (Windows 2000 SP3 only)

   5.00.3700.1000   Internet Explorer 5.01 SP4 (Windows 2000 SP4 only)

   5.50.3825.1300   Internet Explorer 5.5 Developer Preview (Beta)

   5.50.4030.2400   Internet Explorer 5.5 & Internet Tools Beta

   5.50.4134.0100   Internet Explorer 5.5 for Windows Me (4.90.3000)

   5.50.4134.0600   Internet Explorer 5.5

   5.50.4308.2900   Internet Explorer 5.5 Advanced Security Privacy Beta

   5.50.4522.1800   Internet Explorer 5.5 Service Pack 1

   5.50.4807.2300   Internet Explorer 5.5 Service Pack 2

   6.00.2462.0000   Internet Explorer 6 Public Preview (Beta)

   6.00.2479.0006   Internet Explorer 6 Public Preview (Beta) Refresh

   6.00.2600.0000   Internet Explorer 6 (Windows XP)

   6.00.2800.1106   Internet Explorer 6 Service Pack 1 (Windows XP SP1)

   6.00.2900.2180   Internet Explorer 6 for Windows XP SP2

   6.00.2900.5512   Internet Explorer 6 for Windows XP SP3

   6.00.3663.0000   Internet Explorer 6 for Windows Server 2003 RC1 

   6.00.3718.0000   Internet Explorer 6 for Windows Server 2003 RC2

   6.00.3790.0000   Internet Explorer 6 for Windows Server 2003 (released)

   6.00.3790.1830   Internet Explorer 6 for Windows Server 2003 SP1 and Windows XP x64

   6.00.3790.3959   Internet Explorer 6 SP2 for Windows Server 2003 SP1 and Windows XP x64   

   7.00.5730.1100   Internet Explorer 7 for Windows XP and Windows Server 2003

   7.00.5730.1300   Internet Explorer 7 for Windows XP and Windows Server 2003

   7.00.6000.16386   Internet Explorer 7 for Windows Vista

   7.00.6000.16441   Internet Explorer 7 for Windows Server 2003 SP2 x64

   7.00.6000.16441   Internet Explorer 7 for Windows XP SP2 x64

   7.0.6001.1800     Internet Explorer 7 for Windows Server 2008 and for Windows Vista SP1

   8.0.6001.17184   Internet Explorer 8 Beta 1

   8.00.6001.18241   Internet Explorer 8 Beta 2

  评论这张
 
阅读(2684)| 评论(1)
推荐 转载

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018