«« Site Rescued »»

While the site is still going to move from its current host, a new site will now take its place. More Info.

The new site may have less content, but the core will now remain. And it will now play nicely with phones! Keep an eye on the DelphiDabbler Blog for news.

» Help

How to determine the screen resolution

   

There are two ways to determine the screen's height and width.

Use the global Screen variable

uses
  Forms;
...
Screen.Height { Screen height in pixels }
Screen.Width  { Screen width in pixels  }
...

Use the Windows API GetSystemMetrics() function

This function can be useful in applications that don't use the VCL like console applications.

uses
  Windows;
...
GetSystemMetric(SM_CXSCREEN) { Screen height in pixels }
GetSystemMetric(SM_CYSCREEN) { Screen width in pixels  }
...
Author: Unknown
Added: 2007-06-02
Last updated: 2007-06-02

« Return to contents »