Dan Waters
df.waters at comcast.net
Mon May 27 13:27:13 CDT 2013
Forgot to include:
'--------------------------------
Option Compare Database
Option Explicit
Private Type OSVERSIONINFO
dwOSVersionInfoSize As Long
dwMajorVersion As Long
dwMinorVersion As Long
dwBuildNumber As Long
dwPlatformId As Long
szCSDVersion As String * 128
End Type
Public Declare Function GetVersionExA Lib "kernel32" (lpVersionInformation
As OSVERSIONINFO) As Integer
Public Function WindowsVersion() As String
Dim osinfo As OSVERSIONINFO
Dim retvalue As Integer
osinfo.dwOSVersionInfoSize = 148
osinfo.szCSDVersion = Space$(128)
retvalue = GetVersionExA(osinfo)
WindowsVersion = osinfo.dwMajorVersion & "." & osinfo.dwMinorVersion & "
Build (" & osinfo.dwBuildNumber & ") " & fTrimNull(osinfo.szCSDVersion)
End Function
Private Function fTrimNull(strIn As String) As String
Dim intPos As Integer
intPos = InStr(1, strIn, vbNullChar)
If intPos <> 0 Then
fTrimNull = Mid$(strIn, 1, intPos - 1)
Else
fTrimNull = strIn
End If
End Function
'---------------------------------------------