views:

75

answers:

2

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.

+2  A: 

Take a look at the MSDN article Getting the System Version

While the article only mentions currently supported Windows versions, see this knowledge base article for the numbers you'll see in the OSVERSIONINFO structure for Win 95, 98 etc.

Paul Dixon
+3  A: 

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

nico
It does say: `Minimum supported client: Windows 2000 Professional`
nc3b
Pretty sure that API has been in Win32 API since Windows 95
Paul Dixon
nc3b
I don't know why they revised all the MSDN documentation changing the "minimum supported client" voice to Windows 2000 Professional for all the "old" APIs. That's plain stupid, there was no need for that.
Matteo Italia
@Matteo Italia: Probably some stupid corporate decision to piss off developers. :)
nico
Yes, I too think that it's because of such thing. Fortunately, I've still got my MSDN 2003, with all the correct "Minimum supported" versions.
Matteo Italia