Private Type DLLVERSIONINFO cbSize As Long dwMajorVersion As Long dwMinorVersion As Long dwBuildNumber As Long dwPlatformID As Long End TypePrivate Declare Function DllGetVersion Lib "Shlwapi.dll" (dwVersion As DLLVERSIONINFO) As LongPublic Function GetIEVersion() As String Dim tDLLVerInfo As DLLVERSIONINFO Dim lMajor As Long, lMinor As Long, lBuild As Long Dim r As Long tDLLVerInfo.cbSize = Len(tDLLVerInfo) r = DllGetVersion(tDLLVerInfo) If r = 0 Then With tDLLVerInfo lMajor = .dwMajorVersion lMinor = .dwMinorVersion lBuild = .dwBuildNumber End With GetIEVersion = lMajor & "." & lMinor & "." & lBuild Else GetIEVersion = "" End If End Function '调用 Private Sub Form_Load() MsgBox "IE Ver:" & GetIEVersion End Sub
cbSize As Long
dwMajorVersion As Long
dwMinorVersion As Long
dwBuildNumber As Long
dwPlatformID As Long
End TypePrivate Declare Function DllGetVersion Lib "Shlwapi.dll" (dwVersion As DLLVERSIONINFO) As LongPublic Function GetIEVersion() As String
Dim tDLLVerInfo As DLLVERSIONINFO
Dim lMajor As Long, lMinor As Long, lBuild As Long
Dim r As Long
tDLLVerInfo.cbSize = Len(tDLLVerInfo)
r = DllGetVersion(tDLLVerInfo)
If r = 0 Then
With tDLLVerInfo
lMajor = .dwMajorVersion
lMinor = .dwMinorVersion
lBuild = .dwBuildNumber
End With
GetIEVersion = lMajor & "." & lMinor & "." & lBuild
Else
GetIEVersion = ""
End If
End Function
'调用
Private Sub Form_Load()
MsgBox "IE Ver:" & GetIEVersion
End Sub