/* * Internet Explorer information program * 01.05.27 : Makoto NARA(Mc.N) * * Histry: * 00.06.30 : Makoto NARA(Mc.N) : include IE version. * 01.08.27 : Makoto NARA(Mc.N) : include IE5.5 SP2, IE6 Beta Refresh * * See follow this. * - How to Determine Which Version of Internet Explorer Is Installed * [http://support.microsoft.com/support/kb/articles/Q164/5/39.ASP] * - [IE5] Internet Explorer 5.0 のリリースされたバージョンとビルド番号 * [http://www.microsoft.com/Japan/support/kb/articles/J051/6/55.HTM] */ /* * Copyright (c) 2000-2001 Makoto NARA(Mc.N) All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY Makoto NARA(Mc.N) ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #define STRICT #include #include #include typedef struct tagIE_VERSION{ char* szIEnumber; char* szIEname; } IE_VERSION, PIE_VERSION; IE_VERSION ie_ver[] = { {"4.40.308", "Internet Explorer 1.0 (Plus!)"}, {"4.40.520", "Internet Explorer 2.0"}, {"4.70.1155", "Internet Explorer 3.0"}, {"4.70.1158", "Internet Explorer 3.0 (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 (SP1)"}, {"4.72.3612.1713", "Internet Explorer 4.01 Service Pack 2 (SP2)"}, {"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, build5.00.2128)"}, {"5.00.2919.6307", "Internet Explorer 5.01 (Internet Explorer 5.01 (Also included with Office 2000 SR-1, but not installed by default)"}, {"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)"}, {"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)"}, {"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 (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"}, {NULL, NULL} }; IE_VERSION ie_oldver[] = { {"308", "Internet Explorer 1.0 (Plus!)"}, {"520", "Internet Explorer 2.0"}, {"1155", "Internet Explorer 3.0"}, {"1158", "Internet Explorer 3.0 (OSR2)"}, {"1215", "Internet Explorer 3.01"}, {"1300", "Internet Explorer 3.02 and 3.02a"}, {NULL, NULL} }; // Prototype BOOL ViewGetVersionIE(void); int main(void) { ViewGetVersionIE(); return 0; } BOOL ViewGetVersionIE(void) { HKEY hIekey; LONG lRet; BYTE bBuff[512]; DWORD dwType, cbBuff; int i; printf("IE version information:\n"); lRet = RegOpenKeyEx( HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Internet Explorer", 0, KEY_READ, &hIekey ); if( lRet != ERROR_SUCCESS ){ printf("Can't open IE version registry key[%d]\n", GetLastError()); return FALSE; } dwType = REG_SZ; cbBuff = sizeof(bBuff); lRet = RegQueryValueEx( hIekey, "Version", NULL, &dwType, bBuff, &cbBuff ); if( lRet != ERROR_SUCCESS ){ dwType = REG_SZ; cbBuff = sizeof(bBuff); lRet = RegQueryValueEx( hIekey, "Build", NULL, &dwType, bBuff, &cbBuff ); RegCloseKey( hIekey ); if( lRet != ERROR_SUCCESS ){ printf("Can't found IE version registry key[%d]\n", GetLastError()); return FALSE; } // Query old IE build (IE 3.x?) for( i = 0; i<(sizeof(ie_oldver)/sizeof(ie_oldver[0])); i++ ){ if( ie_oldver[i].szIEname == NULL ){ printf( "unknown IE famiry [%s]\n", bBuff ); return TRUE; } if( 0 == strcmp(bBuff, ie_oldver[i].szIEnumber) ){ printf( "%s [%s]\n", ie_oldver[i].szIEname, ie_oldver[i].szIEnumber ); return TRUE; } } }else{ RegCloseKey( hIekey ); } // Query IE version (above IE 4.0) for( i = 0; i<(sizeof(ie_ver)/sizeof(ie_ver[0])); i++ ){ if( ie_ver[i].szIEname == NULL ){ printf( "unknown IE famiry [%s]\n", bBuff ); return TRUE; } if( 0 == strcmp(bBuff, ie_ver[i].szIEnumber) ){ printf( "%s [%s]\n", ie_ver[i].szIEname, ie_ver[i].szIEnumber ); return TRUE; } } return TRUE; }