Declare Function GetVersionEx Lib "kernel32.dll" Alias "GetVersionExA" (lpVersionInformation As OSVERSIONINFO) As Long
Type OSVERSIONINFO
dwOSVersionInfoSize As Long
dwMajorVersion As Long
dwMinorVersion As Long
dwBuildNumber As Long
dwPlatformId As Long
szCSDVersion As String * 128
End Type
Dim os As OSVERSIONINFO ' receives version information
Dim retval As Long ' return value
os.dwOSVersionInfoSize = Len(os) ' set the size of the structure
retval = GetVersionEx(os) ' read Windows's version information
Debug.Print "Windows version number:"; os.dwMajorVersion; "."; os.dwMinorVersion
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.