Get OS in c++ win32 for all versions of win?

c++, operating-system, winapi, windows

Solution

Use `GetVersionEx` http://msdn.microsoft.com/en-us/library/ms724451%28v=VS.85%29.aspx

Problem

How to get the OS version for all windows, at least the name for win95,98,me,xp,vista,7? Im using visual c++ 2010 and I want to include this feature in a pure win32 app.

Original source