سلام
تغییر Resolution و Refresh Rate
function TForm1.DisplaySettings(const ScreenWidth, ScreenHeight, RefreshRate: integer): integer;
var
DevMode: TDeviceMode;
begin
with DevMode do
begin
dmSize := SizeOf(DevMode);
dmPelsWidth := ScreenWidth;
dmPelsHeight := ScreenHeight;
dmDisplayFrequency := RefreshRate;
dmFields := DM_BITSPERPEL or DM_PELSWIDTH or DM_PELSHEIGHT or DM_DISPLAYFREQUENCY;
end;
Result := ChangeDisplaySettings(DevMode, CDS_UPDATEREGISTRY);
case Result of
DISP_CHANGE_SUCCESSFUL:; {'The settings change was successful.'}
DISP_CHANGE_RESTART : MessageDlg('The computer must be restarted in order for the graphics mode to work.', mtInformation, [mbOK], 0);
DISP_CHANGE_BADFLAGS : MessageDlg('An invalid set of flags was passed in.', mtInformation, [mbOK], 0);
DISP_CHANGE_FAILED : MessageDlg('The display driver failed the specified graphics mode.', mtInformation, [mbOK], 0);
DISP_CHANGE_BADMODE : MessageDlg('The graphics mode is not supported.', mtInformation, [mbOK], 0);
DISP_CHANGE_NOTUPDATED: MessageDlg('Unable to write settings to the registry.', mtInformation, [mbOK], 0);
end;
end;