Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2006 Dec : Change resolution on second monitor

www.cryer.info
Managed Newsgroup Archive

Change resolution on second monitor

Subject:Change resolution on second monitor
Posted by:"Christian Dubois" (cdubo..@.logilys.com)
Date:Wed, 6 Dec 2006 09:57:13

Hello everybody,

How can I, with Delphi 7, change the resolution on a secondary monitor.
I try to specify the name of the monitor with EnumDisplaySettings and then
change the resolution with ChangeDisplaySettings, but it always change the
resolution of my primary solution.

Can someone help me please?
Christian Dubois, Logilys inc.

Here is the code I use :

procedure TfTVMain.ModifierEcranFin(Largeur,Hauteur,Couleur: Integer);
var
  Ecran: TDevMode;
begin
  EnumDisplaySettings('\.\Display2', 0, Ecran);
  Ecran.dmPelsWidth := Largeur;
  Ecran.dmPelsHeight := Hauteur;
  Ecran.dmBitsPerPel := Couleur;
  ChangeDisplaySettings(Ecran, CDS_UPDATEREGISTRY);
end;

Replies:

www.cryer.info
Managed Newsgroup Archive