I have a large Win API C++ Application that i recently moved from Visual Studio 2010 to 2017. Application compiles, links and runs now, but i find that the window borders are about 2 pixels larger than before.
This is a problem as we implemented docking windows long time ago with 100% own code. Although all sizes are retrieved from the OS using GetSystemMetrics etc. this turned out to need some more specific alignment. It took a lot of development time when developing (for Windows 2000) and retargeting later for Windows 7. Furthermore we have some small windows and the thicker frames just waste space.
So i installed the Windows SDK 7.1 and was able after some tweaks to install that. But i am not able to choose 7.1 in the project settings. Typing in that in the project settings results in
error MSB8036: The Windows SDK version 7.1 was not found.
Although I find a directory named:
C:\Program Files\Microsoft SDKs\Windows\v7.1
Also when trying to re-target the Project, the SDK 7.1 is not listed. I did a lot of googling and found this and that but no substantial answer. msdn is horrible.
Questions (obsolet, see below):
EDIT:
I don't think that this is a duplicate of Dialog border different after porting code from Visual Studio 6 to Visual Studio 2013 although the link is quite helpful. It turned out, that different values are returned for GetSystemMetrics(SM_CYFRAME). So far I do not see a substantial explanation for that. Please see my own answer and comments.
So let me update the question:
Why does the value returned from GetSystemMetrics(SM_CYFRAME) change when upgrading from VC2010 to VC2017?
What is the root cause?
Is it possible to use VC 2017 with Windows 7 SDK? How?
Yes, but I doubt this is the solution to your main problem.
Is there possibly a different way to keep the geometry used with VC2010?
Yes, just change the minimum subsystem version to pre-Vista value, like 5.01 (for Windows XP 32-bit). For some reason, 5.1 will yield the same result too; the resulting EXE would be the same.
When Win32 Subsystem Version is 6.0 or above, there is a behavior change regarding the window border size. Though I am not aware of where Microsoft has documented about this.

If you still have Windows 7, the difference is also obvious when you are using Windows Basic theme, as shown in this screenshot:

Screenshot added by RED SOFT ADAIR:

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