Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is WINVER?

I was looking at some code and they had this line: #define WINVER 0x0501 in stdafx.h file? Why do you need to define WINVER? How does it affect your code? Can someone please explain?

like image 369
aajkaltak Avatar asked Sep 17 '09 15:09

aajkaltak


People also ask

Is Winver exe a virus?

winver.exe is a legitimate file. This process is known as Sistema operacional Microsoft® Windows. It belongs to Microsoft® Windows® Operating System and was developed by Microsoft. It is commonly stored in C:\WINDOWS\.

How do you define Winver?

WINVER means Windows Version. In a nutshell, if you're building for a particular version of Windows, some APIs are available that are not available on previous versions.

Where is Winver located?

If you prefer to launch winver manually, you'll find winver.exe located in C: > Windows > System32.

How do I know if I have Winver?

To find out which version of Windows your device is running, press the Windows logo key key + R, type winver in the Open box, and then select OK.


2 Answers

WINVER determines the minimum platform SDK required to build your application, which in turn will determine at compile time which routines are found by the headers.

You can use this to verify, at compile time, that your application will work on Windows 2000 (0x0500), for example, or on Windows XP (0x0501).

MSDN's page on Modifying WINVER and _WIN32_WINNT goes into this in more detail.

like image 105
Reed Copsey Avatar answered Oct 06 '22 08:10

Reed Copsey


WINVER defines the minimum Windows system the program can run on. There's a more detailed explanation at MSDN. What #define WINVER 0x0501 means is that the program requires Windows XP or Server 2003 to run, and that it therefore can use Windows functionality up through that release.

like image 28
David Thornley Avatar answered Oct 06 '22 08:10

David Thornley