-
Can anyone help me to get all the current Windows versions? Preferably even after a SP has ben applied if the version number changed.
There are so many, and they some want their API stuff different. So versions numbers of Windows 95/98/98SE/98ME/NT351/NT4/W2000
Wish I had such a version history :D
-
You can easily find that out:
Code:
Option Explicit
Private Type OSVERSIONINFO
dwOSVersionInfoSize As Long
dwMajorVersion As Long
dwMinorVersion As Long
dwBuildNumber As Long
dwPlatformId As Long
szCSDVersion As String * 128 ' Maintenance string for PSS usage
End Type
Private Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" (lpVersionInformation As OSVERSIONINFO) As Long
Private Const VER_PLATFORM_WIN32_NT = 2
Private Const VER_PLATFORM_WIN32_WINDOWS = 1
Public Function GetWindowsVersion() As String
Dim os As OSVERSIONINFO
Dim strVersion As String
Dim strSP As String
os.dwOSVersionInfoSize = Len(os)
os.szCSDVersion = Space(255)
Call GetVersionEx(os)
With os
Select Case .dwPlatformId
Case VER_PLATFORM_WIN32_WINDOWS
If .dwMinorVersion = 0 Then
strVersion = "Windows 95"
ElseIf .dwMinorVersion = 10 Then
strVersion = "Windows 98"
End If
Case VER_PLATFORM_WIN32_NT
If .dwMajorVersion = 3 Then
strVersion = "Windows NT 3.51"
ElseIf .dwMajorVersion = 4 Then
strVersion = "Windows NT 4.0"
ElseIf .dwMajorVersion = 5 Then
strVersion = "Windows 2000"
End If
strSP = Trim(.szCSDVersion)
End Select
strVersion = strVersion & vbCrLf & .dwMajorVersion & "." & .dwMinorVersion & "." & .dwBuildNumber
strVersion = strVersion & vbCrLf & strSP
End With
GetWindowsVersion = strVersion
End Function
Private Sub Form_Load()
MsgBox GetWindowsVersion
End Sub
-
Serge, does it return 'Windows 98', if ME is installed?
-
Actually I'm not sure, since I don't have WindowsME installed (and I dont know any one who does). But what you can do is to check if the dwMajorVersion has changed.
If it's not, then dwMinorVersion will be changed for sure.
Regards,
-