Zjištění verze Internet Exploreru

Postup:
V modulu deklarujte:

Private Type DllVersionInfo 
cbSize As Long 
dwMajorVersion As Long 
dwMinorVersion As Long 
dwBuildNumber As Long 
dwPlatformID As Long 
End Type 

Private Declare Function DllGetVersion Lib "Shlwapi.dll" _ 
(dwVersion As DllVersionInfo) As Long 

Public Function IEVersion() As Long 

Dim VersionInfo As DllVersionInfo 

VersionInfo.cbSize = Len(VersionInfo) 
Call DllGetVersion(VersionInfo) 
IEVersion = VersionInfo.dwMajorVersion 

End Function 

Public Function IEVersionString() 

Dim VersionInfo As DllVersionInfo 

VersionInfo.cbSize = Len(VersionInfo) 
Call DllGetVersion(VersionInfo) IEVersionString = "Internet Explorer " & _
VersionInfo.dwMajorVersion & "." & _ 
VersionInfo.dwMinorVersion & "." & _ 
VersionInfo.dwBuildNumber 

End Function

Použití:

MsgBox IEVersion 
MsgBox IEVersionString

Zatímco funkce IEVersion vrací pouze hlavní číslo verze, což je užitečné pouze pro otestování kompatibility, druhá funkce vrací kompletní řetězec, např. "Internet Explorer 5.0.2314", který může být vhodný pro zobrazení informace uživateli.

Zpět

Autor: The Bozena