IsWindows10OrGreater function (versionhelpers.h)
Indicates if the current OS version matches, or is greater than, the Windows 10 version.
Syntax
VERSIONHELPERAPI IsWindows10OrGreater();
Return value
True if the current OS version matches, or is greater than, the Windows 10 version; otherwise, false.
Remarks
Applications not manifested for Windows 10 return false, even if the current operating system version is Windows 10. To manifest your applications for Windows 10, see Targeting your application for Windows.
The version helper functions do not differentiate between client and server releases. They return true if the current OS version number is equal to or higher than the version of the client named in the call. For example, a call to IsWindowsXPSP3OrGreater will return true on Windows Server 2008. Applications that need to distinguish between server and client versions of Windows should call IsWindowsServer.
For situations where a Windows Server version number isn't shared with a Windows client release, you can use IsWindowsVersionOrGreater to confirm.
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 your application requires Windows 10 or later, use the following test.
#include <VersionHelpers.h>
…
if (!IsWindows10OrGreater())
{
MessageBox(NULL, "You need at least Windows 10.", "Version Not Supported", MB_OK);
}
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 2000 Professional [desktop apps only] |
Minimum supported server | Windows 2000 Server [desktop apps only] |
Target Platform | Windows |
Header | versionhelpers.h |
Library | Kernel32.lib; Ntdll.lib |
DLL | Kernel32.dll; Ntdll.dll |