Export (0) Print
Expand All

IsWindowsVersionOrGreater function

Important  You should only use this function if the other provided Version Helper functions do not fit within your scenarios.

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 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

VersionHelpers.h (include Windows.h)

Library

Kernel32.lib;
Ntdll.lib

DLL

Kernel32.dll;
Ntdll.dll

See also

IsWindowsXPOrGreater
IsWindowsXPSP1OrGreater
IsWindowsXPSP2OrGreater
IsWindowsXPSP3OrGreater
IsWindowsVistaOrGreater
IsWindowsVistaSP1OrGreater
IsWindowsVistaSP2OrGreater
IsWindows7OrGreater
IsWindows7SP1OrGreater
IsWindows8OrGreater
IsWindows8Point1OrGreater
IsWindowsServer

 

 

Community Additions

ADD
Show:
© 2014 Microsoft