取得当前监视器的分辨率

2020-09-14



var

  MonInfo: TMonitorInfo;

begin

  MonInfo.cbSize := SizeOf(MonInfo);

  GetMonitorInfo(MonitorFromWindow(Handle, MONITOR_DEFAULTTONEAREST), @MonInfo);

  ShowMessage(Format('Current resolution: %dx%d',

              [MonInfo.rcMonitor.Right - MonInfo.rcMonitor.Left,

               MonInfo.rcMonitor.Bottom - MonInfo.rcMonitor.Top]));

end;


阅读496