动态设置屏幕分辨率

2020-09-14

Xe10.2测试可用。


function SetScreen(x, y: Word): Boolean;

var

   DevMode: TDeviceMode;

begin

   Result := EnumDisplaySettings(nil, 0, DevMode);

   if Result then

   begin

    DevMode.dmFields := DM_PELSWIDTH or DM_PELSHEIGHT;

    DevMode.dmPelsWidth := x;

    DevMode.dmPelsHeight := y;

    Result := ChangeDisplaySettings(DevMode, 0) = DISP_CHANGE_SUCCESSFUL;

   end;

end;


阅读379