

You can use GetDpiForMonitor using the headers and libs of the appropriate Windows SDK.


The major point of my posts is to aid in the learning process. I may also give inefficient code or introduce some problems to discourage copy/paste coding. They are meant to just illustrate a point. Any samples given are not meant to have error checking or show best practices. You do the same thing in the Visual Studio environment too. SDK include paths, update the LIBPATH environment variable to set any of the Windows SDK library paths to the new Windows SDK library paths and then try to build something that uses the Windows API on the command line. You can open up one of the command line environments, update the INCLUDE environment variable so that and of the Windows SDK include paths are directed to the new Windows This is something that you can try in the command line environment just to be sure. You will however have to do the manual changing of the paths for the Windows SDK headers and libraries because most of the time the Windows SDK will not be registered with older versions of Visual Studio. For the raw Windows API itself, then the headers and libraries will be usable because the format of the import libraries hasn't changed in forever and the headers are still written to be quite This isn't as simple a question as you probably think it is.
