Click here to Skip to main content
15,885,216 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
According to the documentation, no. However it doesn't make sense that Windows 10 is required to detect whether Windows 10 is running.

What I have tried:

Checking IsWindows10OrGreater function (Windows)[^]
Posted
Updated 14-Mar-17 0:45am

1 solution

The MSDN seems to be misleading here. IsWindows10OrGreater requires the Windows 10 SDK and (I'm not absolutely sure with this) that the application is manifested for Windows 10.

If your application is not manifested for Windows 10, IsWindows10OrGreater will return false (or fail to work - I'm again not sure) even when running on Windows 10.

You may also have a look at the VersionHelpers.h file. The used functions are supported since Windows 2000.

So it should work when specifying Windows 10 in the manifest and not used at all otherwise.

[EDIT]
When not specifying Windows 10 in the manifest there are solutions to detect Windows 10. However, such is ot recommended by Microsoft.
Part1: Overcoming Windows 8.1's deprecation of GetVersionEx and GetVersion APIs[^]
Getting Operating System Version Info - Even for Windows 10![^]
[/EDIT]
 
Share this answer
 
v2
Comments
Michael Haephrati 14-Mar-17 8:27am    
The question is : how can a single program check if the OS used is Windows 10 (or greater), while such program can run on any earlier version of Windows as well.
Jochen Arndt 14-Mar-17 8:39am    
When specifying Windows 10 in the manifest it should work (but I can't test it at the moment).

When not, there is no "official" method because IsWindowsVersionOrGreater which is called by IsWindows10OrGreater will return false even when the application is running on Windows 10. The same applies to other GetVersion API functions.

Then you have to leave the "official" way.
Some links (I will add them to my solution too):
https://www.codeproject.com/Articles/678606/Part-Overcoming-Windows-s-deprecation-of-GetVe
https://www.codeproject.com/Articles/73000/Getting-Operating-System-Version-Info-Even-for-Win

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900