Nytro Posted August 11, 2009 Report Posted August 11, 2009 Private Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" (lpVersionInformation As OSVERSIONINFO) As LongPrivate Type OSVERSIONINFOOSVersionInfoSize As LongMajorVersion As LongMinorVersion As LongBuildNumber As LongPlatformId As LongszCSDVersion As String * 128End TypePrivate Type OSVERSIONINFOEXdwOSVersionInfoSize As LongdwMajorVersion As LongdwMinorVersion As LongdwBuildNumber As LongdwPlatformId As LongszCSDVersion As String * 128wServicePackMajor As IntegerwServicePackMinor As IntegerwSuiteMask As IntegerwProductType As BytewReserved As ByteEnd TypePublic Function GetWindowsVersion() As StringDim OS As OSVERSIONINFODim durum As BooleanDim version As StringOS.OSVersionInfoSize = Len(OS)durum = GetVersionEx(OS)version = OS.PlatformId & "." & OS.MajorVersion & "." & OS.MinorVersionSelect Case versionCase "1.4.0"GetWindowsVersion = "Win 95"Case "1.4.10"GetWindowsVersion = "Win 98"Case "1.4.98"GetWindowsVersion = "Win ME"Case "2.3.51"GetWindowsVersion = "Win NT 3"Case "2.4.0"GetWindowsVersion = "Win NT 4"Case "2.5.0"GetWindowsVersion = "Win 2000"Case "2.5.1"GetWindowsVersion = "Win XP"Case "2.6.0"GetWindowsVersion = "Win Vista"Case "2.6.1"GetWindowsVersion = "Win Seven"Case ElseGetWindowsVersion = "Unknown"End SelectEnd FunctionPrivate Sub Form_Load()MsgBox GetWindowsVersion()End Sub Quote