Set resolution of screen

Posted in System info

Use ChangeDispleySettings function with TDeviceModeA structure for this problem.

procedure TForm1.Button1Click(Sender: TObject);
var
  MyMode: TDeviceModeA;
begin
  MyMode.dmSize:=Sizeof(MyMode);
  MyMode.dmFields:=DM_PELSWIDTH	and DM_PELSWIDTH;
  MyMode.dmPelsWidth:=StrToInt(Edit1.Text);
  MyMode.dmPelsHeight:=StrToInt(Edit2.Text);
  ChangeDisplaySettings(MyMode, 0);
end;