How to determine ACTUAL windows form size (with all nonclient elements) when running Aero?

丶灬走出姿态 提交于 2019-11-27 01:48:01

Yes, Aero lies about the window size returned by GetWindowRect(). It is a rather important appcompat hack, without it far too many programs would have a client area that's too small. Unfortunately there's neither an API call nor a manifest entry that can be used to turn off the lie. The only way is to set the Windows version in the EXE header and mark it Vista compatible.

You can do so with Editbin.exe in a postbuild event:

set pathsave=%path%
set path=$(devenvdir);$(devenvdir)..\..\vc\bin
editbin.exe /subsystem:windows,6.0 "$(targetfilename)"
set path=%pathsave%

Beware that your program will not run in XP anymore after this.


UPDATE: this is now done by default in VS2012 and up when you target .NET 4.5

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!