Problem
The resolution reported by Screen.Width/Screen.Height is sometimes (rarely) smaller that the resolution reported in Control Panel. The resolution reported by Delphi is always smaller (about 1/3) than the real resolution. And it 'makes sense'. I mean it seems to be one of those 'round' numbers used for resolution in normal computers, like 1280x720.
I cannot reproduce this in my system but I got few screenshots from 3rd party computers.
Recently I used
var MonInfo: TMonitorInfo;
begin
MonInfo.cbSize := SizeOf(MonInfo);
GetMonitorInfo(MonitorFromWindow(Application.MainForm.Handle, MONITOR_DEFAULTTONEAREST), @MonInfo);
Result:= MonInfo.rcMonitor.Right;
It returns the same (wrong) result as Screen.Width/Screen.Height. This was reported just on a couple of systems (3-4). Two of them were hooked to a external monitor/TV.
Details
Resolution shown by Delphi: 1280x720
Resolution shown by Control Panel: 1920x1080
DPI: 96
Make it easier to read what's on screen: 150%
Test project: I just started a new default project; no properties altered in the ObjInspector. A small test program made in C++ shows also the wrong resolution.
Delphi XE
Question
Which Delphi function will return the correct resolution OR how do I calculate the correct resolution from the resolution reported by Screen.Width (Screen.Height)?
Moved here:
How to obtain the real screen resolution in a High DPI system?