Results 1 to 4 of 4

Thread: What Version of windows is running?

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2000
    Posts
    54

    What Version of windows is running?

    I just want to find out what version of windows is running..

    Thanks in advance for any help..

    ~Jay

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    VB Code:
    1. Private Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" (ByRef lpVersionInformation As OSVERSIONINFO) As Long
    2.  
    3. Private Type OSVERSIONINFO
    4.     dwOSVersionInfoSize As Long
    5.     dwMajorVersion As Long
    6.     dwMinorVersion As Long
    7.     dwBuildNumber As Long
    8.     dwPlatformId As Long
    9.     szCSDVersion As String * 128
    10. End Type
    11.  
    12. Private Const VER_PLATFORM_WIN32s = 0
    13. Private Const VER_PLATFORM_WIN32_WINDOWS = 1
    14. Private Const VER_PLATFORM_WIN32_NT = 2
    15.  
    16. Private Function LoWord(lngIn As Long) As Integer
    17.    If (lngIn And &HFFFF&) > &H7FFF Then
    18.       LoWord = (lngIn And &HFFFF&) - &H10000
    19.    Else
    20.       LoWord = lngIn And &HFFFF&
    21.    End If
    22. End Function
    23.  
    24. Private Function ShowWinVersion(vLabel As Label)
    25. Dim version As OSVERSIONINFO
    26. Dim strPlatform As String
    27.  
    28.     version.dwOSVersionInfoSize = Len(version)
    29.     GetVersionEx version
    30.  
    31.     If version.dwPlatformId = 1 And version.dwMinorVersion = 10 And LoWord(version.dwBuildNumber) = 1998 Then
    32.         strPlatform = "Microsoft Windows 98 "
    33.     ElseIf version.dwPlatformId = 1 And version.dwMinorVersion = 10 And LoWord(version.dwBuildNumber) = 2222 Then
    34.         strPlatform = "Microsoft Windows 98 SE "
    35.     ElseIf version.dwPlatformId = 1 And version.dwMinorVersion = 90 And LoWord(version.dwBuildNumber) = 3000 Then
    36.         strPlatform = "Microsoft Windows ME "
    37.     ElseIf version.dwPlatformId = 1 And version.dwMinorVersion = 0 And LoWord(version.dwBuildNumber) = 950 Then
    38.         strPlatform = "Microsoft Windows 95 "
    39.     ElseIf version.dwPlatformId = 1 And version.dwMinorVersion = 0 And LoWord(version.dwBuildNumber) = 1111 Then
    40.         strPlatform = "Microsoft Windows 95B "
    41.     End If
    42.            
    43.     If version.dwPlatformId = 2 And version.dwMajorVersion = 3 Then
    44.         strPlatform = "Microsoft Windows NT 3.51 "
    45.     ElseIf version.dwPlatformId = 2 And version.dwMajorVersion = 4 Then
    46.         strPlatform = "Microsoft Windows NT "
    47.     ElseIf version.dwPlatformId = 2 And version.dwMajorVersion = 5 Then
    48.         strPlatform = "Microsoft Windows 2000 "
    49.     End If
    50.    
    51.    strPlatform = strPlatform & "v" & Format(version.dwMajorVersion) & "." & _
    52.                        Format(version.dwMinorVersion) & " (Build " & LoWord(version.dwBuildNumber) & ")"
    53.    
    54.     vLabel.Alignment = 2
    55.     vLabel.BackStyle = 0
    56.     vLabel.Caption = strPlatform
    57. End Function
    58.  
    59. Private Sub Form_Load()
    60. 'Developed by amitabh
    61.     ShowWinVersion Label1
    62. End Sub

  3. #3

    Thread Starter
    Member
    Join Date
    Aug 2000
    Posts
    54
    Thank you very very much!!

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    No problem...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width