How do I get the screen resolution?

Mike Parker aldacron at gmail.com
Thu Apr 28 11:41:27 UTC 2022


On Thursday, 28 April 2022 at 11:35:46 UTC, Mike Parker wrote:

> go through the same system APIs. For example, on Windows you 
> can use two calls to `GetSystemMetrics` (one for the width, one 
> for the height). 
> (https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getsystemmetrics)

Been a while since I've done any Win32 stuff directly. In this 
age of multiple monitors, it's probably better to use 
`EnumDisplaySettings' on Windows.

https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-enumdisplaysettingsa

But the best option is like I said above: see how other libraries 
do it.


More information about the Digitalmars-d-learn mailing list