Click here to Skip to main content
15,881,173 members
Articles / Programming Languages / C++
Article

Windows Version Numbers

Rate me:
Please Sign up or sign in to vote.
4.87/5 (11 votes)
11 Jul 2001CPOL2 min read 124.2K   42   9
Values returned by GetVersionEx for Windows operating systems

Introduction

Sometimes you need to know a very simple thing, like "Is it Windows NT?". Some of the solutions to this problem are excellent and very thorough, but seem to be overkill. But when you try to find out what it takes to determine what OS your program is running on, then you find there is no one place to go to.

What Microsoft Says

The facts about what data are returned by GetVersionEx are scattered around Microsoft site. Here are a few articles I have tracked down:

As you will see from reading them, these articles are not complete.

Table of Windows Version Numbers

I have pulled together following table from many different sources, including Usenet news groups, searching web sites, and reading code here and on other developer sites. It is only a beginning, and if you have knowledge to share please email me and I will acknowledge your contribution.

dwPlatformID dwMajorVersion dwMinorVersion dwBuildNumber
95 1 4 0 950
95 SP1 1 4 0 > 950 && <= 1080
95 OSR2 1 4 < 10 > 1080
98 1 4 10 1998
98 SP1 1 4 10 >1998 && < 2183
98 SE 1 4 10 >= 2183
Me 1 4 90 3000
NT 3.51 2 3 51 1057
NT 4 2 4 0 1381
2000 2 5 0 2195
XP 2 5 1  
CE 1.0 3 1 0  
CE 2.0 3 2 0  
CE 2.1 3 2 1  
CE 3.0 3 3 0  

How to use this information

I have developed a simple function which uses this table to return a single value that can be used in applications. The function is called GetWinVer and it is in FontFile demo here.

Future Enhancements

Depending on what readers want to see, there are several areas for new entries:

  • Windows versions prior to Win95
  • CE versions
  • Service pack information for NT

License

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


Written By
Software Developer (Senior) Hans Dietrich Software
United States United States
I attended St. Michael's College of the University of Toronto, with the intention of becoming a priest. A friend in the University's Computer Science Department got me interested in programming, and I have been hooked ever since.

Recently, I have moved to Los Angeles where I am doing consulting and development work.

For consulting and custom software development, please see www.hdsoft.org.






Comments and Discussions

 
QuestionHow to get vista version? (Home Basic, Ultimate...) Pin
Mason Hou13-Apr-07 17:50
Mason Hou13-Apr-07 17:50 
AnswerRe: How to get vista version? (Home Basic, Ultimate...) Pin
FaxedHead1-Oct-07 19:28
FaxedHead1-Oct-07 19:28 
Questionhow to detect the os name Pin
Manoj Singh K22-Mar-05 20:48
Manoj Singh K22-Mar-05 20:48 
AnswerA-a..... Pin
sergeyv200224-Mar-05 6:20
sergeyv200224-Mar-05 6:20 
GeneralWin2003 Pin
Armen Hakobyan5-May-04 7:25
professionalArmen Hakobyan5-May-04 7:25 
AnswerRe: Win2003 Pin
Hans Dietrich19-Apr-11 10:51
mentorHans Dietrich19-Apr-11 10:51 
GeneralAnother version on Code Project... Pin
Mark Findlay12-Jul-01 8:29
Mark Findlay12-Jul-01 8:29 
GeneralRe: Another version on Code Project... Pin
Michael Mac24-Aug-02 1:18
Michael Mac24-Aug-02 1:18 
GeneralRe: Another version on Code Project... Pin
Anonymous8-Oct-03 3:06
Anonymous8-Oct-03 3:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.