This is just one of a few ways to detect the current version of Windows. The reasons for doing are plentiful, but I'm sure most important would be directory locations, Operating System abilities, assumptions of Windows Software, & so on & so on...

First we define the _WIN32_WINNT value :

#define _WIN32_WINNT 0x0500

Next we load some standard headers. Most are used for self-explanatory items. If you are needing to detect the version of Windows for programmatic requirements, then I'm certain you know what these are & why they are in here

Yikes! Are you getting paid by the line of code? Why does you WM_PAINT handler have an EndPaint() with no BeginPaint()? Why do you even have a WM_CREATE handler? Why is your progress bar code setting the range each iteration through the loop? What progress is the progress bar really showing since you already got the version a few lines back? What is the difference between line 79 and 81? What are the magic numbers that you OR in with the MessageBox() options parameter?

Yikes! Are you getting paid by the line of code? Why does you WM_PAINT handler have an EndPaint() with no BeginPaint()? Why do you even have a WM_CREATE handler? Why is your progress bar code setting the range each iteration through the loop? What progress is the progress bar really showing since you already got the version a few lines back? What is the difference between line 79 and 81? What are the magic numbers that you OR in with the MessageBox() options parameter?

The beauty of Dream In Code Tutorials is that one can post their contributions, & someone else can tare it apart so that others can learn why not to repeat something.