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.htmlCodePudding user response:
ChangeDisplaySettingsExCodePudding user response:
https://baike.baidu.com/item/ChangeDisplaySettingsEx/6379797Using ChangeDisplaySettingsEx auspicious fine parameters used to introduce here,