VB Code:
  1. 'constants returned by OperatingSystem
  2. Global Const Windows95 As Integer = 95
  3. Global Const Windows98 As Integer = 98
  4. Global Const WindowsNT3 As Integer = 3 'v3.51
  5. Global Const WindowsNT4 As Integer = 4
  6.  
  7.  
  8. Private Type OSVersionInfo
  9.    dwOSVersionInfoSize As Long
  10.    dwMajorVersion As Long
  11.    dwMinorVersion As Long
  12.    dwBuildNumber As Long
  13.    dwPlatformID As Long
  14.    szCSDVersion As String * 128
  15. End Type
  16.  
  17. Private Declare Function GetVersionExA Lib "kernel32" (lpVersionInformation As OSVersionInfo) As Integer
  18.  
  19. Public Function OperatingSystem() As Integer
  20. Dim OSInfo As OSVersionInfo
  21. Dim RetValue As Integer
  22.  
  23. OSInfo.dwOSVersionInfoSize = 148
  24. OSInfo.szCSDVersion = Space$(128)
  25. RetValue = GetVersionExA(OSInfo)
  26.  
  27. With OSInfo
  28. Select Case .dwPlatformID
  29.    Case 1
  30.       If .dwMinorVersion = 0 Then
  31.          OperatingSystem = Windows95
  32.       ElseIf .dwMinorVersion = 10 Then
  33.          OperatingSystem = Windows98
  34.       End If
  35.    Case 2
  36.       If .dwMajorVersion = 3 Then
  37.          OperatingSystem = WindowsNT3
  38.       ElseIf .dwMajorVersion = 4 Then
  39.          OperatingSystem = WindowsNT4
  40.       End If
  41.    Case Else
  42.       OperatingSystem = 0
  43. End Select
  44. End With
  45. End Function
  46.  
  47. Private Sub Form_Load()
  48. If OperatingSystem = Windows98 Then Image1.Visible = True
  49. End Sub

How do you add Windows XP to that code?