IsWindowsVersionOrGreater function
Indicates if the current OS version matches, or is greater than, the provided version information. This function is useful in confirming a version of Windows Server that doesn't share a version number with a client release.
Syntax
BOOL WINAPI IsWindowsVersionOrGreater( WORD wMajorVersion, WORD wMinorVersion, WORD wServicePackMajor );
Parameters
- wMajorVersion
-
The major OS version number.
- wMinorVersion
-
The minor OS version number.
- wServicePackMajor
-
The major Service Pack version number.
Return value
TRUE if the specified version matches, or is greater than, the version of the current Windows OS; otherwise, FALSE.
Examples
The inline functions defined in the VersionHelpers.h header file let you verify the operating system version by returning a Boolean value when testing for a version of Windows.
For example, if you want to check for a specific version/service pack configuration, regardless of whether the release is server or client, use the following test.
#include <VersionHelpers.h>
…
if (!IsWindowsVersionOrGreater( 5, 0, 1))
{
MessageBox(NULL, "You need at least Windows 2000 with SP1", "Version Not Supported", MB_OK);
}
Requirements
|
Minimum supported client |
Windows Vista [desktop apps only] |
|---|---|
|
Minimum supported server |
Windows Server 2003 [desktop apps only] |
|
Header |
|
See also
- IsWindowsXPOrGreater
- IsWindowsXPSP1OrGreater
- IsWindowsXPSP2OrGreater
- IsWindowsXPSP3OrGreater
- IsWindowsVistaOrGreater
- IsWindowsVistaSP1OrGreater
- IsWindowsVistaSP2OrGreater
- IsWindows7OrGreater
- IsWindows7SP1OrGreater
- IsWindows8OrGreater
- IsWindows8Point10OrGreater
- IsWindowsServer