Home > Back-end >  DELPHI access and adjust the screen resolution of API function> <more screen
DELPHI access and adjust the screen resolution of API function> <more screen

Time:09-15

This section is to take the second screen resolution
ShowMessage (' current resolution is: '+ IntToStr (MyScreen. Monitors [1]. The Width) +' X '+ IntToStr (Screen) Monitors [1], Height));
Online to find the change of resolution function

The function SetScreen (X, Y: Word) : Boolean;
Var
DevMode: TDeviceMode;
The begin
Result:=EnumDisplaySettings (nil, 0, DevMode);
If the Result then
The begin
DevMode. DmFields:=DM_PELSWIDTH or DM_PELSHEIGHT;
DevMode. DmPelsWidth:=X;
DevMode. DmPelsHeight:=Y;
Result:=ChangeDisplaySettings (DevMode, 0)=DISP_CHANGE_SUCCESSFUL;
The end;
The end;
But this function can only change the first screen, what I want to change the second screen.

CodePudding user response:

EnumDisplayDevices: enumeration display device; EnumDisplaySettings: retrieve the graphic display of equipment support mode,

CodePudding user response:

Look at this https://www.cnblogs.com/FuYan/p/4972894.html

CodePudding user response:

ChangeDisplaySettingsEx

CodePudding user response:

https://baike.baidu.com/item/ChangeDisplaySettingsEx/6379797
Using ChangeDisplaySettingsEx auspicious fine parameters used to introduce here,
  • Related