I found another way to get the screen resolution in Windows that is
consistent between 32bit and 64bit programs using GetSystemMetrics.

uses
  Windows;

var
  ScreenWidth, ScreenHeight: Integer;

begin
  ScreenWidth := GetSystemMetrics(SM_CXSCREEN);
  ScreenHeight := GetSystemMetrics(SM_CYSCREEN);

  WriteLn('Screen Width: ', ScreenWidth, ' pixels');
  WriteLn('Screen Height: ', ScreenHeight, ' pixels');
end.

This works well, and with PTCGraph, there is really no need to bother
figuring out what video modes are available anyway, especially now that we
can have custom resolutions for the PTCGraph window, I just need to make
sure it fits on the screen so it really doesn't matter how I get the screen
resolution.

James

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to