For example, on my machine I set 125% scale and can get only 864p instead of 1080p
On Windows 11 calling SetThreadDpiAwarenessContext(DPI_AWARENESS_CONTEXT_SYSTEM_AWARE); before getting
int w = GetSystemMetrics(SM_CXSCREEN), h = GetSystemMetrics(SM_CYSCREEN); works fine. But UI looks smaller and probably needs to be scaled up accordingly.