GetVersionEx Function

Declare Function GetVersionEx Lib "kernel32.dll" Alias "GetVersionExA" (lpVersionInformation As OSVERSIONINFO) As Long

Platforms: Win 32s, Win 95/98, Win NT

GetVersionEx reads information about the version of Windows running as the operating system. This information includes the strict version number and platform (3.x with Win32s, Windows 95, Windows NT, Windows 98, etc.). The information is put into the variable passed as lpVersionInformation. The function returns 0 if an error occured, or a 1 if successful.

lpVersionInformation
Receives the version information for the operating system.

Example:

' Display the major and minor version numbers of Windows.
' For example, 4.0 could represent Windows 95.
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

Category: System Information

Go back to the alphabetical Function listing.
Go back to the Reference section index.


This page is copyright © 2000 Paul Kuliniewicz. Copyright Information.
Go back to the Windows API Guide home page.
E-mail: vbapi@vbapi.com Send Encrypted E-Mail
This page is at http://www.vbapi.com/ref/g/getversionex.html