Skip to main content

Posts

Showing posts from March, 2019

How to get OS version. Part 2.

Not so long time ago I have published short article about reading Windows OS version. I have got lot of e-mails asking me for source code. In fact, there is nothing hard to do what I described but after describing it lot of times I decided to create few units with read OS version functions.

There are three units: for Delphi, for C# and for C++.

You can download it on GitHub

I use this method in my Wireless Communication Library and it works great on all supported platforms in any possible situation (at least for now).

Should you have any question please contact me by mike@btframework.com

How to get OS version

Have you ever tried to get correct OS version number on Windows 10? If yes, you know what the pain in the ass it is.

Old days we can simple call GetVersion() or GetVersionEx() and can be sure that information returned by the function is ansolutely correct.

However, starting from Windows 8.1 Microsoft has changed the behavior of those functions. Now it returns weather on the Mars but not OS version. This is how it is described in MSDN

With the release of Windows 8.1, the behavior of the GetVersion API has changed in the value it will return for the operating system version. The value returned by the GetVersion function now depends on how the application is manifested.

Applications not manifested for Windows 8.1 or Windows 10 will return the Windows 8 OS version value (6.2). Once an application is manifested for a given operating system version, GetVersion will always return the version that the application is manifested for in future releases. They offer to use IsOSxxx functions.…