Web development India freelance website designer developer India SEO

Finds the OS version of Windows 95/SP1/OSR2, Win 98/SP1/SE, Win ME, Win NT 3.51/4.0, Windows 2000,
Windows XP, Windows CE 1.0/2.0/2.1/3.0. (Revised Version)

Public Declare Function GetVersionExA Lib "kernel32" (lpVersionInformation As OSVERSIONINFO) As Integer

Public Type OSVERSIONINFO
dwOSVersionInfoSize As Long
dwMajorVersion As Long
dwMinorVersion As Long
dwBuildNumber As Long
dwPlatformId As Long
szCSDVersion As String * 128
End Type


Public Function GetWindowsVersion() As String
Dim OSInfo As OSVERSIONINFO
Dim Ret As Integer
OSInfo.dwOSVersionInfoSize = 148
OSInfo.szCSDVersion = Space$(128)
Ret = GetVersionExA(OSInfo)

With OSInfo

Select Case .dwPlatformId
Case 1

If .dwMinorVersion < 10 Then

If .dwBuildNumber = 950 Then
GetWindowsVersion = "Windows 95"
ElseIf .dwBuildNumber > 950 Or .dwBuildNumber <= 1080 Then
GetWindowsVersion = "Windows 95 SP1"
Else
GetWindowsVersion = "Windows 95 OSR2"
End If
ElseIf .dwMinorVersion = 10 Then


If .dwBuildNumber = 1998 Then
GetWindowsVersion = "Windows 98"
ElseIf .dwBuildNumber > 1998 Or .dwBuildNumber < 2183 Then
GetWindowsVersion = "Windows 98 SP1"
ElseIf .dwBuildNumber >= 2183 Then
GetWindowsVersion = "Windows 98 SE"
End If
Else
GetWindowsVersion = "Windows ME"
End If
Case 2

If .dwMajorVersion = 3 Then
GetWindowsVersion = "Windows NT 3.51"
ElseIf .dwMajorVersion = 4 Then
GetWindowsVersion = "Windows NT 4.0"
ElseIf .dwMajorVersion = 5 Then

If .dwMinorVersion = 0 Then
GetWindowsVersion = "Windows 2000"
Else
GetWindowsVersion = "Windows XP"
End If
End If
Case 3

If .dwMajorVersion = 1 Then
GetWindowsVersion = "Windows CE 1.0"
ElseIf .dwMajorVersion = 2 Then

If .dwMinorVersion = 0 Then
GetWindowsVersion = "Windows CE 2.0"
Else
GetWindowsVersion = "Windows CE 2.1"
End If
Else
GetWindowsVersion = "Windows CE 3.0"
End If
Case Else
GetWindowsVersion = "Unable To get Windows Version"
End Select
End With
End Function
Get Windows Version

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150

India web developer web development India | India web development company India ecommerce web developer