We had a project built for Win2K, then WinXP, then Win7 that has now been converted from a 32-bit Win7 program using VS2010 to a 64-bit Win10 program using VS2017. The VS2017 project was created from scratch and the old sources where then imported and updated as needed.
When I created the new project, I set the Target Platform (in the project's Configuration, General section) to Windows 10 and since I have no special needs, I set the project to build a manifest automatically.
Today I noticed that the dialog we have that shows the current Windows version info in the program says they we are running under Windows 8.1, internal version number 6.2. When I looked up the GetVersionInfo function I found out that it "lies" for programs that do not have a manifest saying they target Windows 10.
My question is in two parts:
I freely admit my ignorance of the manifest stuff. To date, I have not knowingly run into any situation where I needed to know about it.
[EDIT] Just a minor comment for the "this is a duplicate" crowd. My program doesn't CARE what version of Windows it finds, but it needs to REPORT as much detail about that version as possible. We display the information in one of our dialogs (and write it to a file) that we use when supporting customers. This allows us to ensure we build a test system with the exact same Windows as the customer. The primary focus of the "duplicates" is to ensure a program is running on the correct version of Windows, while mine is reporting all of the Windows version info I can find, so to me, this is NOT actually a duplicate of the others, although the RtlGetVersion() function (thanks @RemyLebeau) appears to solve both types of problem.
Proceed like this:
First create a manifest file in your project folder and call it for example manifest.xml, then add it to your project in the Solution Explorer:

It should have this content:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="asInvoker" uiAccess="false"></requestedExecutionLevel>
</requestedPrivileges>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"></supportedOS>
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"></supportedOS>
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"></supportedOS>
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"></supportedOS>
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"></supportedOS>
</application>
</compatibility>
</assembly>
Then right click on your project in the Solution Explorer. And modify the as shown below:

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With