I would like some of my apps to be able to detect the screen resolution and or the number of colours set at start up.
I suppose these are stored in the registry somewhere does anyone know where they are and or if there are any other ways to do this?
I know you can check this through Delphi because Ive done it but I cant for the life of me remember how. If however like myself you find your self cehcking things like this a lot you might want to check out this page
and download the freeware component called MiTeC System Information Component v.7.62. It gives a lot of info about your computer and takes up very little room in a final install.
There is a component called Screen which comes free with your app. Just use Screen.Width and Screen.Height for the dimensions of the screen you're on. There are also properties for the Desktop dimensions, and an array of Monitors, for dimensions of other screens attached to this computer.
Colour depth now, hmm, there I can't help you. There's TChart.IsScreenHighColor; but that's pretty lame. -- Doug Burbidge mailto:doug@ultrazone.com
procedure TForm1.FormCreate(Sender: TObject);
var
i : Integer;
DevMode : TDevMode;
begin
i:=0;
while EnumDisplaySettings(nil,i,DevMode) do begin
with Devmode do
ListBox1.Items.Add
(Format('%dx%d %d Colors',
[dmPelsWidth,dmPelsHeight,1 shl dmBitsperPel]));
Inc(i);
end;
end;
It puts the display settings in a listbox, and combining it with screen.width and screen.height it must be possible to detect the current color mode
S. van Els
SAvanEls@cq-link.sr
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.