I just want to find out what version of windows is running..
Thanks in advance for any help..
~Jay
Printable View
I just want to find out what version of windows is running..
Thanks in advance for any help..
~Jay
VB Code:
Private Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" (ByRef lpVersionInformation As OSVERSIONINFO) As Long Private Type OSVERSIONINFO dwOSVersionInfoSize As Long dwMajorVersion As Long dwMinorVersion As Long dwBuildNumber As Long dwPlatformId As Long szCSDVersion As String * 128 End Type Private Const VER_PLATFORM_WIN32s = 0 Private Const VER_PLATFORM_WIN32_WINDOWS = 1 Private Const VER_PLATFORM_WIN32_NT = 2 Private Function LoWord(lngIn As Long) As Integer If (lngIn And &HFFFF&) > &H7FFF Then LoWord = (lngIn And &HFFFF&) - &H10000 Else LoWord = lngIn And &HFFFF& End If End Function Private Function ShowWinVersion(vLabel As Label) Dim version As OSVERSIONINFO Dim strPlatform As String version.dwOSVersionInfoSize = Len(version) GetVersionEx version If version.dwPlatformId = 1 And version.dwMinorVersion = 10 And LoWord(version.dwBuildNumber) = 1998 Then strPlatform = "Microsoft Windows 98 " ElseIf version.dwPlatformId = 1 And version.dwMinorVersion = 10 And LoWord(version.dwBuildNumber) = 2222 Then strPlatform = "Microsoft Windows 98 SE " ElseIf version.dwPlatformId = 1 And version.dwMinorVersion = 90 And LoWord(version.dwBuildNumber) = 3000 Then strPlatform = "Microsoft Windows ME " ElseIf version.dwPlatformId = 1 And version.dwMinorVersion = 0 And LoWord(version.dwBuildNumber) = 950 Then strPlatform = "Microsoft Windows 95 " ElseIf version.dwPlatformId = 1 And version.dwMinorVersion = 0 And LoWord(version.dwBuildNumber) = 1111 Then strPlatform = "Microsoft Windows 95B " End If If version.dwPlatformId = 2 And version.dwMajorVersion = 3 Then strPlatform = "Microsoft Windows NT 3.51 " ElseIf version.dwPlatformId = 2 And version.dwMajorVersion = 4 Then strPlatform = "Microsoft Windows NT " ElseIf version.dwPlatformId = 2 And version.dwMajorVersion = 5 Then strPlatform = "Microsoft Windows 2000 " End If strPlatform = strPlatform & "v" & Format(version.dwMajorVersion) & "." & _ Format(version.dwMinorVersion) & " (Build " & LoWord(version.dwBuildNumber) & ")" vLabel.Alignment = 2 vLabel.BackStyle = 0 vLabel.Caption = strPlatform End Function Private Sub Form_Load() 'Developed by amitabh ShowWinVersion Label1 End Sub
Thank you very very much!!
No problem...:)