I am building Desktop apps with Visual Studio C++ 2017 on Windows 10. Compatibility with Windows 7 and 8 is required.
May I use the latest Windows 10 SDK for this, or do I have to use the Windows 8.1 SDK?
You can use the Windows 10 SDK to write Windows desktop applications compatible with Windows 7 and up. The minimum target version is controlled through preprocessor symbols (WINVER and _WIN32_WINNT). Set them to 0x0601 to target Windows 7 and up.
See Using the Windows Headers for details.
targetver.hthen look at the posible definitions of_WIN32_WINNTin<SDKDDKVer.h>. Define_WIN32_WINNTwith the appropriate value in your project build options. Defining_WIN32_WINNTwith the appropriate version removes newer/updated APIs from the windows header files. The temporary project is just so you can see clean versions of the files, delete it when you are done investigating.